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

(cherry picked from commit 5926058)
  • Loading branch information
sandydoo authored and Enzime committed Feb 14, 2025
1 parent f81c161 commit c363e6c
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 @@ -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 =
Expand Down

0 comments on commit c363e6c

Please sign in to comment.