From 4e2f331f872ba43e43fc62792ce4c96827fd4c7a Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Thu, 18 Jun 2026 12:44:57 -0400 Subject: [PATCH] lib.lists.toposort: avoid reversing element causing a cycle --- lib/lists.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lists.nix b/lib/lists.nix index 75cdf3cbf499..9863c064426d 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -1262,7 +1262,7 @@ rec { else if dfsthis ? cycle then # there's a cycle, starting from the current vertex, return it { - cycle = reverseList ([ dfsthis.cycle ] ++ dfsthis.visited); + cycle = reverseList dfsthis.visited ++ [ dfsthis.cycle ]; inherit (dfsthis) loops; } else if toporest ? cycle then