Skip to content

Commit

Permalink
nix: place extra-prefixed settings after their non-prefixed variants
Browse files Browse the repository at this point in the history
Fixes #626.

Essentially a copy of NixOS's workaround: NixOS/nixpkgs#278064
  • Loading branch information
sandydoo committed Feb 14, 2025
1 parent a674621 commit 5926058
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,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 =
Expand Down

0 comments on commit 5926058

Please sign in to comment.