Merge pull request #83166 from avnik/nix-build-location
This commit is contained in:
commit
35eb7793a3
@ -430,6 +430,16 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
buildLocation = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "/tmp";
|
||||||
|
example = "/var/buildroot";
|
||||||
|
description = ''
|
||||||
|
Temporary directory, which used to unpack and build source packages.
|
||||||
|
(by default <filename>/tmp</filename> is used, which commonly reside on tmpfs,
|
||||||
|
and big packages (like browsers) can just not fit there)
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -476,7 +486,9 @@ in
|
|||||||
++ optionals cfg.distributedBuilds [ pkgs.gzip ];
|
++ optionals cfg.distributedBuilds [ pkgs.gzip ];
|
||||||
|
|
||||||
environment = cfg.envVars
|
environment = cfg.envVars
|
||||||
// { CURL_CA_BUNDLE = "/etc/ssl/certs/ca-certificates.crt"; }
|
// { CURL_CA_BUNDLE = "/etc/ssl/certs/ca-certificates.crt";
|
||||||
|
TMPDIR = cfg.buildLocation;
|
||||||
|
}
|
||||||
// config.networking.proxy.envVars;
|
// config.networking.proxy.envVars;
|
||||||
|
|
||||||
unitConfig.RequiresMountsFor = "/nix/store";
|
unitConfig.RequiresMountsFor = "/nix/store";
|
||||||
@ -490,6 +502,8 @@ in
|
|||||||
restartTriggers = [ nixConf ];
|
restartTriggers = [ nixConf ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [ "d ${cfg.buildLocation} 0775 root root -" ];
|
||||||
|
|
||||||
# Set up the environment variables for running Nix.
|
# Set up the environment variables for running Nix.
|
||||||
environment.sessionVariables = cfg.envVars //
|
environment.sessionVariables = cfg.envVars //
|
||||||
{ NIX_PATH = cfg.nixPath;
|
{ NIX_PATH = cfg.nixPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user