1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-31 04:04:45 +00:00

nix: place extra-prefixed settings after their non-prefixed variants

Fixes #626.

Essentially a copy of NixOS's workaround: https://github.com/NixOS/nixpkgs/pull/278064

(cherry picked from commit 5926058aec)
This commit is contained in:
Sander 2025-02-14 16:33:12 +04:00 committed by Michael Hoang
parent f81c16138a
commit c363e6c967

View file

@ -49,13 +49,16 @@ let
mkKeyValuePairs = attrs: concatStringsSep "\n" (mapAttrsToList mkKeyValue attrs);
isExtra = key: hasPrefix "extra-" key;
in
pkgs.writeTextFile {
name = "nix.conf";
text = ''
# WARNING: this file is generated from the nix.* options in
# your nix-darwin configuration. Do not edit it!
${mkKeyValuePairs cfg.settings}
${mkKeyValuePairs (filterAttrs (key: value: !(isExtra key)) cfg.settings)}
${mkKeyValuePairs (filterAttrs (key: value: isExtra key) cfg.settings)}
${cfg.extraOptions}
'';
checkPhase =