diff options
Diffstat (limited to 'nixos/modules/config/nix.nix')
-rw-r--r-- | nixos/modules/config/nix.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/nixos/modules/config/nix.nix b/nixos/modules/config/nix.nix new file mode 100644 index 00000000000..78cab3c7f8c --- /dev/null +++ b/nixos/modules/config/nix.nix @@ -0,0 +1,42 @@ +/* + Manages /etc/nix.conf, build machines and any nix-specific global config files. + */ +{ config, lib, pkgs, ... }: + +let + + cfg = config.nix; + + inherit (lib) + mapAttrsToList + mkRenamedOptionModuleWith + ; + + legacyConfMappings = { + useSandbox = "sandbox"; + buildCores = "cores"; + maxJobs = "max-jobs"; + sandboxPaths = "extra-sandbox-paths"; + binaryCaches = "substituters"; + trustedBinaryCaches = "trusted-substituters"; + binaryCachePublicKeys = "trusted-public-keys"; + autoOptimiseStore = "auto-optimise-store"; + requireSignedBinaryCaches = "require-sigs"; + trustedUsers = "trusted-users"; + allowedUsers = "allowed-users"; + systemFeatures = "system-features"; + }; + +in +{ + imports = + mapAttrsToList + (oldConf: newConf: + mkRenamedOptionModuleWith { + sinceRelease = 2205; + from = [ "nix" oldConf ]; + to = [ "nix" "settings" newConf ]; + }) + legacyConfMappings; + +} |