diff options
author | Robert Hensing <robert@roberthensing.nl> | 2023-12-07 20:02:13 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2023-12-08 22:15:30 +0100 |
commit | 7438f4e0de4f41a562c4292a035f406129208bfd (patch) | |
tree | bd0b1b5578af33625b0fff3bd3a74aae9bff1cf4 /nixos/modules/services/backup | |
parent | 016993237f083abba26f436eb201ac35ecc3ebd3 (diff) |
nixos/btrbk: Optimize sort
This avoids computing the prio more than necessary.
The test evaluates to the same derivation hash.
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 1e90ef54d33f..3cbbf0f1bd5c 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: |