From dc626693352250f21f0d2c6492757e6a916bcfc6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 7 Jul 2015 15:01:36 +0200 Subject: [PATCH] =?UTF-8?q?Set=20=E2=80=98allowSubstitutes=20=3D=20false?= =?UTF-8?q?=E2=80=99=20on=20various=20derivations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reduces the number of binary cache requests. See https://github.com/NixOS/nix/commit/b64988bb3585478676585a0f0aecbcf4e11d4432. --- nixos/modules/services/hardware/udev.nix | 3 +++ nixos/modules/services/system/dbus.nix | 3 +++ nixos/modules/system/activation/top-level.nix | 1 + nixos/modules/system/boot/systemd-lib.nix | 16 +++++++++++++--- nixos/modules/system/etc/etc.nix | 1 + pkgs/build-support/trivial-builders.nix | 1 + 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index 50588e449587..fc89de777e8e 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -28,7 +28,10 @@ let # Perform substitutions in all udev rules files. udevRules = stdenv.mkDerivation { name = "udev-rules"; + preferLocalBuild = true; + allowSubstitutes = false; + buildCommand = '' mkdir -p $out shopt -s nullglob diff --git a/nixos/modules/services/system/dbus.nix b/nixos/modules/services/system/dbus.nix index 853b458cf589..5c20901427cb 100644 --- a/nixos/modules/services/system/dbus.nix +++ b/nixos/modules/services/system/dbus.nix @@ -12,7 +12,10 @@ let configDir = pkgs.stdenv.mkDerivation { name = "dbus-conf"; + preferLocalBuild = true; + allowSubstitutes = false; + buildCommand = '' mkdir -p $out diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix index b19fea57f6bf..839300798167 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -101,6 +101,7 @@ let if [] == failed then pkgs.stdenv.mkDerivation { name = "nixos-${config.system.nixosVersion}"; preferLocalBuild = true; + allowSubstitutes = false; buildCommand = systemBuilder; inherit (pkgs) utillinux coreutils; diff --git a/nixos/modules/system/boot/systemd-lib.nix b/nixos/modules/system/boot/systemd-lib.nix index 873fff15d384..8acaa5212f5f 100644 --- a/nixos/modules/system/boot/systemd-lib.nix +++ b/nixos/modules/system/boot/systemd-lib.nix @@ -13,13 +13,20 @@ rec { pathSafeName = lib.replaceChars ["@" ":" "\\"] ["-" "-" "-"] name; in if unit.enable then - pkgs.runCommand "unit-${pathSafeName}" { preferLocalBuild = true; inherit (unit) text; } + pkgs.runCommand "unit-${pathSafeName}" + { preferLocalBuild = true; + allowSubstitutes = false; + inherit (unit) text; + } '' mkdir -p $out echo -n "$text" > $out/${shellEscape name} '' else - pkgs.runCommand "unit-${pathSafeName}-disabled" { preferLocalBuild = true; } + pkgs.runCommand "unit-${pathSafeName}-disabled" + { preferLocalBuild = true; + allowSubstitutes = false; + } '' mkdir -p $out ln -s /dev/null $out/${shellEscape name} @@ -89,7 +96,10 @@ rec { as)); generateUnits = type: units: upstreamUnits: upstreamWants: - pkgs.runCommand "${type}-units" { preferLocalBuild = true; } '' + pkgs.runCommand "${type}-units" + { preferLocalBuild = true; + allowSubstitutes = false; + } '' mkdir -p $out # Copy the upstream systemd units we're interested in. diff --git a/nixos/modules/system/etc/etc.nix b/nixos/modules/system/etc/etc.nix index b57b03bcf962..300ae0acda53 100644 --- a/nixos/modules/system/etc/etc.nix +++ b/nixos/modules/system/etc/etc.nix @@ -14,6 +14,7 @@ let builder = ./make-etc.sh; preferLocalBuild = true; + allowSubstitutes = false; /* !!! Use toXML. */ sources = map (x: x.source) etc'; diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index d9eeaa31359d..9203425b20ae 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -23,6 +23,7 @@ rec { passAsFile = [ "text" ]; # Pointless to do this on a remote machine. preferLocalBuild = true; + allowSubstitutes = false; } '' n=$out${destination}