Novelist Sir Ian Rankin has been announced as the first ever guest programmer for an “epic” crime writing festival.