summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2020-11-08 09:40:27 +0300
committerVika Shleina <vika@fireburn.ru>2021-05-22 05:14:56 +0000
commitaeeee447bcc181d57a19d348f857326f4e1959fe (patch)
tree59ed620c972e5452a71e945927f93c638b0fcff2 /nixos
parent7cb549910c93a0b3e9269f065e778200b4068df5 (diff)
nixos/nix-daemon: fix sandbox-paths option
In newer versions of Nix (at least on 2.4pre20201102_550e11f) the
`extra-` prefix for config options received a special meaning and the
option `extra-sandbox-paths` isn't recognized anymore. This commit fixes
it.

It doesn't cause a behavior change when using older versions of Nix but
does cause an extra newline to appear in the config, thus changing the
hash.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/nix-daemon.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index 133e96da0ec8e..df745fa7168bc 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -12,6 +12,8 @@ let
 
   isNix23 = versionAtLeast nixVersion "2.3pre";
 
+  isNix24 = versionAtLeast nixVersion "2.4pre";
+
   makeNixBuildUser = nr: {
     name  = "nixbld${toString nr}";
     value = {
@@ -41,7 +43,11 @@ let
         max-jobs = ${toString (cfg.maxJobs)}
         cores = ${toString (cfg.buildCores)}
         sandbox = ${if (builtins.isBool cfg.useSandbox) then boolToString cfg.useSandbox else cfg.useSandbox}
-        extra-sandbox-paths = ${toString cfg.sandboxPaths}
+        ${if isNix24 then ''
+          sandbox-paths = ${toString cfg.sandboxPaths}
+        '' else ''
+          extra-sandbox-paths = ${toString cfg.sandboxPaths}
+        ''}
         substituters = ${toString cfg.binaryCaches}
         trusted-substituters = ${toString cfg.trustedBinaryCaches}
         trusted-public-keys = ${toString cfg.binaryCachePublicKeys}