about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2019-12-08 13:40:38 +0100
committerProfpatsch <mail@profpatsch.de>2019-12-08 13:55:01 +0100
commit5e0baa153e62f8a66462622474e5cd0ee4206b22 (patch)
tree0f1682c3b137feebd5cf3e50814203ff784db1eb /pkgs
parentf3bc66cbbc4e14940c5b05b1078d1b40fb9807ee (diff)
treewide: use `runCommandLocal` where applicable
`runCommandLocal` was added to nixpkgs in
https://github.com/NixOS/nixpkgs/pull/74642
to speed up trivial `runCommand` derivations by always building them
locally. We have a few places where that’s good to use.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/profpatsch/default.nix8
-rw-r--r--pkgs/profpatsch/display-infos/default.nix4
-rw-r--r--pkgs/profpatsch/nman/default.nix4
-rw-r--r--pkgs/profpatsch/sandbox.nix2
-rw-r--r--pkgs/profpatsch/testing/default.nix6
-rw-r--r--pkgs/taalo-build/default.nix4
6 files changed, 10 insertions, 18 deletions
diff --git a/pkgs/profpatsch/default.nix b/pkgs/profpatsch/default.nix
index eba52312..5cd28182 100644
--- a/pkgs/profpatsch/default.nix
+++ b/pkgs/profpatsch/default.nix
@@ -54,16 +54,10 @@ let
       };
     in import src { nixpkgs = pkgs; };
 
-  runCommandLocal = name: args: cmd:
-    pkgs.runCommand name (args // {
-      preferLocalBuild = true;
-      allowSubstitutes = false;
-    }) cmd;
-
   testing = import ./testing {
     inherit stdenv lib;
     inherit (runExeclineFns) runExecline;
-    inherit (pkgs) runCommand;
+    inherit (pkgs) runCommandLocal;
     bin = getBins pkgs.s6PortableUtils [ "s6-touch" "s6-echo" ];
   };
 
diff --git a/pkgs/profpatsch/display-infos/default.nix b/pkgs/profpatsch/display-infos/default.nix
index b626e844..b8bb2a07 100644
--- a/pkgs/profpatsch/display-infos/default.nix
+++ b/pkgs/profpatsch/display-infos/default.nix
@@ -1,4 +1,4 @@
-{ lib, runCommand, writeText, python3, libnotify, bc, sfttime }:
+{ lib, runCommandLocal, writeText, python3, libnotify, bc, sfttime }:
 
 let
   name = "display-infos-0.1.0";
@@ -61,7 +61,7 @@ let
   '';
 
 in
-  with lib; runCommand "display-infos" {
+  with lib; runCommandLocal "display-infos" {
     meta.description = "Script to display time & battery";
   } ''
     substitute ${script} script \
diff --git a/pkgs/profpatsch/nman/default.nix b/pkgs/profpatsch/nman/default.nix
index bbf4f00f..96699833 100644
--- a/pkgs/profpatsch/nman/default.nix
+++ b/pkgs/profpatsch/nman/default.nix
@@ -1,6 +1,6 @@
-{ lib, runCommandNoCC, go }:
+{ lib, runCommand, go }:
 
-runCommandNoCC "nman" {
+runCommand "nman" {
   meta = with lib; {
     description = "Invoke manpage in temporary nix-shell";
     license = licenses.gpl3;
diff --git a/pkgs/profpatsch/sandbox.nix b/pkgs/profpatsch/sandbox.nix
index b3107f5a..733cd956 100644
--- a/pkgs/profpatsch/sandbox.nix
+++ b/pkgs/profpatsch/sandbox.nix
@@ -26,7 +26,7 @@ let
       mount = "${pkgs.utillinux}/bin/mount";
       unshare = "${pkgs.utillinux}/bin/unshare";
       # this is the directory the sandbox runs under (in a separate mount namespace)
-      newroot = pkgs.runCommand "sandbox-root" {} ''mkdir "$out"'';
+      newroot = pkgs.runCommandLocal "sandbox-root" {} ''mkdir "$out"'';
       # this runs in a separate namespace, sets up a chroot root
       # and then chroots into the new root.
       sandbox = writeExecline "sandbox" {} (builtins.concatLists [
diff --git a/pkgs/profpatsch/testing/default.nix b/pkgs/profpatsch/testing/default.nix
index 21f814e4..76d43ecc 100644
--- a/pkgs/profpatsch/testing/default.nix
+++ b/pkgs/profpatsch/testing/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, runCommand, lib
+{ stdenv, runCommandLocal, lib
 , runExecline, bin }:
 
 let
@@ -15,13 +15,11 @@ let
   drvSeqL = drvDeps: drvOut: let
   drvOutOutputs = drvOut.outputs or ["out"];
   in
-    runCommand drvOut.name {
+    runCommandLocal drvOut.name {
       # we inherit all attributes in order to replicate
       # the original derivation as much as possible
       outputs = drvOutOutputs;
       passthru = drvOut.drvAttrs;
-      preferLocalBuild = true;
-      allowSubstitutes = false;
       # depend on drvDeps (by putting it in builder context)
       inherit drvDeps;
     }
diff --git a/pkgs/taalo-build/default.nix b/pkgs/taalo-build/default.nix
index 383b974f..09ff41d4 100644
--- a/pkgs/taalo-build/default.nix
+++ b/pkgs/taalo-build/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, runCommand, coreutils, nixUnstable }:
+{ stdenv, lib, runCommandLocal, coreutils, nixUnstable }:
 
 let
   nixRemote = "ssh-ng://nix-remote-build@taalo.headcounter.org?compress=true";
@@ -16,7 +16,7 @@ let
   emitScript = content:
     "echo -n ${lib.escapeShellArg "#!${stdenv.shell}\nset -e\n${content}"}";
 
-in runCommand "taalo-build" {} ''
+in runCommandLocal "taalo-build" {} ''
   mkdir -p "$out/bin"
 
   ${emitScript (''