Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3940ec2ed2f2
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 35eb7793a3c1
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 18, 2020

  1. nixos: Introduce nix.buildLocation option

    Allow to specify where package build will happens.
    It helps big packages (like browsers) not to overflow tmpfs.
    avnik committed Apr 18, 2020
    Copy the full SHA
    5291925 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    35eb779 View commit details
Showing with 15 additions and 1 deletion.
  1. +15 −1 nixos/modules/services/misc/nix-daemon.nix
16 changes: 15 additions & 1 deletion nixos/modules/services/misc/nix-daemon.nix
Original file line number Diff line number Diff line change
@@ -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 ];

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;

unitConfig.RequiresMountsFor = "/nix/store";
@@ -490,6 +502,8 @@ in
restartTriggers = [ nixConf ];
};

systemd.tmpfiles.rules = [ "d ${cfg.buildLocation} 0775 root root -" ];

# Set up the environment variables for running Nix.
environment.sessionVariables = cfg.envVars //
{ NIX_PATH = cfg.nixPath;