From caad548415edb0cfe20d29a363aa98137fd7cc2b Mon Sep 17 00:00:00 2001 From: Michon van Dooren Date: Mon, 18 Nov 2024 22:49:51 +0100 Subject: [PATCH] Make vdev sort only move empty modes to the start --- lib/types/zpool.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types/zpool.nix b/lib/types/zpool.nix index 5aed203..12b9cca 100644 --- a/lib/types/zpool.nix +++ b/lib/types/zpool.nix @@ -169,7 +169,7 @@ in formatVdev = type: vdev: formatOutput type vdev.mode vdev.members; formatVdevList = type: vdevs: lib.concatMapStrings (formatVdev type) - (builtins.sort (a: b: a.mode < b.mode) vdevs); + (builtins.sort (a: _: a.mode == "") vdevs); hasTopology = !(builtins.isString config.mode); mode = if hasTopology then "prescribed" else config.mode; topology = lib.optionalAttrs hasTopology config.mode.topology;