From 5926058aecd67ec1bf5030b5a419c260876ea9ba Mon Sep 17 00:00:00 2001 From: Sander Date: Fri, 14 Feb 2025 16:33:12 +0400 Subject: [PATCH] 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 --- modules/nix/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/nix/default.nix b/modules/nix/default.nix index b201a692e..eeaf47bd8 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -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 =