diff --git a/system/activate-configuration.sh b/system/activate-configuration.sh index cd80ec502a71..e0527962369f 100644 --- a/system/activate-configuration.sh +++ b/system/activate-configuration.sh @@ -96,6 +96,9 @@ if test -z "@readOnlyRoot@"; then # WARNING: this file is generated. build-users-group = nixbld build-max-jobs = @maxJobs@ + +@extraNixOptions@ + EOF chown root.nixbld /nix/store diff --git a/system/options.nix b/system/options.nix index 99df9153ac51..5bbc1e99707d 100644 --- a/system/options.nix +++ b/system/options.nix @@ -847,6 +847,17 @@ "; } + { + name = ["nix" "extraOptions"]; + default = ""; + example = " + gc-keep-outputs = true + gc-keep-derivations = true + "; + description = " + This option allows to append lines to nix.conf. + "; + } { name = ["security" "setuidPrograms"]; diff --git a/system/system.nix b/system/system.nix index 14bb3f5a708f..e1371d68f4ab 100644 --- a/system/system.nix +++ b/system/system.nix @@ -249,6 +249,7 @@ rec { config.get ["security" "setuidPrograms"] ++ config.get ["security" "extraSetuidPrograms"]; maxJobs = config.get ["nix" "maxJobs"]; + extraNixOptions = config.get ["nix" "extraOptions"]; inherit (usersGroups) createUsersGroups usersList groupsList;