summaryrefslogtreecommitdiff
path: root/modules/nix/default.nix
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-01-21 13:46:30 +0100
committerDaiderd Jordan <daiderd@gmail.com>2018-01-21 13:46:30 +0100
commitdc33fe3d896db66de6314de3fef653fb80d4aa24 (patch)
tree001091d74e7911e3c06c0a7377a1b7b6f2da14f4 /modules/nix/default.nix
parentb761ee79a37f596b517a7ba243a95dd90c860b51 (diff)
system: use preferLocalBuild for simple derivations
Most of the builds like system.build.etc will be faster when built locally, they also don't depend on CC.
Diffstat (limited to 'modules/nix/default.nix')
-rw-r--r--modules/nix/default.nix52
1 files changed, 27 insertions, 25 deletions
diff --git a/modules/nix/default.nix b/modules/nix/default.nix
index 9bf3e0d..81e0ab9 100644
--- a/modules/nix/default.nix
+++ b/modules/nix/default.nix
@@ -16,31 +16,33 @@ let
sh = pkgs.stdenv.shell;
binshDeps = pkgs.writeReferencesToFile sh;
in
- pkgs.runCommand "nix.conf" { extraOptions = cfg.extraOptions; } ''
- cat > $out <<END
- # WARNING: this file is generated from the nix.* options in
- # your NixOS configuration, typically
- # /etc/nixos/configuration.nix. Do not edit it!
- ${optionalString config.services.nix-daemon.enable ''
- build-users-group = nixbld
- ''}
- build-max-jobs = ${toString cfg.maxJobs}
- build-cores = ${toString cfg.buildCores}
- build-use-sandbox = ${if (builtins.isBool cfg.useSandbox) then (if cfg.useSandbox then "true" else "false") else cfg.useSandbox}
- ${optionalString (cfg.sandboxPaths != []) ''
- build-sandbox-paths = ${toString cfg.sandboxPaths}
- ''}
- binary-caches = ${toString cfg.binaryCaches}
- trusted-binary-caches = ${toString cfg.trustedBinaryCaches}
- binary-cache-public-keys = ${toString cfg.binaryCachePublicKeys}
- ${optionalString cfg.requireSignedBinaryCaches ''
- signed-binary-caches = *
- ''}
- trusted-users = ${toString cfg.trustedUsers}
- allowed-users = ${toString cfg.allowedUsers}
- $extraOptions
- END
- '';
+ pkgs.runCommandNoCC "nix.conf"
+ { preferLocalBuild = true; extraOptions = cfg.extraOptions; }
+ ''
+ cat > $out <<END
+ # WARNING: this file is generated from the nix.* options in
+ # your NixOS configuration, typically
+ # /etc/nixos/configuration.nix. Do not edit it!
+ ${optionalString config.services.nix-daemon.enable ''
+ build-users-group = nixbld
+ ''}
+ build-max-jobs = ${toString cfg.maxJobs}
+ build-cores = ${toString cfg.buildCores}
+ build-use-sandbox = ${if (builtins.isBool cfg.useSandbox) then (if cfg.useSandbox then "true" else "false") else cfg.useSandbox}
+ ${optionalString (cfg.sandboxPaths != []) ''
+ build-sandbox-paths = ${toString cfg.sandboxPaths}
+ ''}
+ binary-caches = ${toString cfg.binaryCaches}
+ trusted-binary-caches = ${toString cfg.trustedBinaryCaches}
+ binary-cache-public-keys = ${toString cfg.binaryCachePublicKeys}
+ ${optionalString cfg.requireSignedBinaryCaches ''
+ signed-binary-caches = *
+ ''}
+ trusted-users = ${toString cfg.trustedUsers}
+ allowed-users = ${toString cfg.allowedUsers}
+ $extraOptions
+ END
+ '';
in
{