diff options
author | Robert Hensing <robert@roberthensing.nl> | 2023-12-07 20:02:13 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2023-12-09 20:31:02 +0100 |
commit | e22a57f97de2db1535f821f3d5a11174bbf5ecd9 (patch) | |
tree | 17105382f392562915440b4e7eda2f966137e346 /nixos/modules/services/backup | |
parent | 0bb4c53b2ebe10f3e25a849a5c21593cea8593a3 (diff) |
nixos/btrbk: Optimize sort
This avoids computing the prio more than necessary. The test evaluates to the same derivation hash. (cherry picked from commit 7438f4e0de4f41a562c4292a035f406129208bfd)
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r-- | nixos/modules/services/backup/btrbk.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/backup/btrbk.nix b/nixos/modules/services/backup/btrbk.nix index 1e90ef54d33f9..3cbbf0f1bd5c0 100644 --- a/nixos/modules/services/backup/btrbk.nix +++ b/nixos/modules/services/backup/btrbk.nix @@ -13,7 +13,7 @@ let mkIf mkOption optionalString - sort + sortOn types ; @@ -37,7 +37,7 @@ let genConfig = set: let pairs = mapAttrsToList (name: value: { inherit name value; }) set; - sortedPairs = sort (a: b: prioOf a < prioOf b) pairs; + sortedPairs = sortOn prioOf pairs; in concatMap genPair sortedPairs; genSection = sec: secName: value: |