diff --git a/src/default.nix b/src/default.nix index 8d971425..c5696318 100644 --- a/src/default.nix +++ b/src/default.nix @@ -187,7 +187,7 @@ in let if b.pathExists (./. + "/external") then ./. else - pkgs.runCommand "dream2nix-full-src" {} '' + pkgs.runCommandLocal "dream2nix-full-src" {} '' cp -r ${./.} $out chmod +w $out mkdir $out/external diff --git a/src/fetchers/crates-io/default.nix b/src/fetchers/crates-io/default.nix index 48467eb2..4f2e5a7e 100644 --- a/src/fetchers/crates-io/default.nix +++ b/src/fetchers/crates-io/default.nix @@ -5,7 +5,7 @@ outputs = { fetchurl, - runCommand, + runCommandLocal, utils, ... }: { @@ -29,7 +29,7 @@ name = "download-${pname}-${version}"; }; in - runCommand "unpack-${pname}-${version}" {} + runCommandLocal "unpack-${pname}-${version}" {} '' mkdir -p $out tar --strip-components 1 -xzf ${fetched} -C $out diff --git a/src/subsystems/haskell/builders/default/default.nix b/src/subsystems/haskell/builders/default/default.nix index 2c7269a2..ef09ed63 100644 --- a/src/subsystems/haskell/builders/default/default.nix +++ b/src/subsystems/haskell/builders/default/default.nix @@ -39,7 +39,7 @@ in { } @ args: let b = builtins; - all-cabal-hashes = pkgs.runCommand "all-cabal-hashes" {} '' + all-cabal-hashes = pkgs.runCommandLocal "all-cabal-hashes" {} '' mkdir $out cd $out tar --strip-components 1 -xf ${pkgs.all-cabal-hashes} diff --git a/src/subsystems/haskell/translators/stack-lock/default.nix b/src/subsystems/haskell/translators/stack-lock/default.nix index 0a6a1d87..e94eb9ac 100644 --- a/src/subsystems/haskell/translators/stack-lock/default.nix +++ b/src/subsystems/haskell/translators/stack-lock/default.nix @@ -79,7 +79,7 @@ in { }: let haskellUtils = import ./utils.nix {inherit dlib lib pkgs;}; all-cabal-hashes = let - all-cabal-hashes' = pkgs.runCommand "all-cabal-hashes" {} '' + all-cabal-hashes' = pkgs.runCommandLocal "all-cabal-hashes" {} '' mkdir $out cd $out tar --strip-components 1 -xf ${pkgs.all-cabal-hashes} diff --git a/src/subsystems/haskell/translators/stack-lock/utils.nix b/src/subsystems/haskell/translators/stack-lock/utils.nix index bb9a98d4..2a0d7f2f 100644 --- a/src/subsystems/haskell/translators/stack-lock/utils.nix +++ b/src/subsystems/haskell/translators/stack-lock/utils.nix @@ -10,7 +10,7 @@ sha256 = "1qc703yg0babixi6wshn5wm2kgl5y1drcswgszh4xxzbrwkk9sv7"; }); in rec { - all-cabal-hashes = pkgs.runCommand "all-cabal-hashes" {} '' + all-cabal-hashes = pkgs.runCommandLocal "all-cabal-hashes" {} '' mkdir $out cd $out tar --strip-components 1 -xf ${pkgs.all-cabal-hashes} @@ -22,7 +22,7 @@ in rec { # parse cabal file via IFD fromCabal = file: name: let file' = l.path {path = file;}; - jsonFile = pkgs.runCommand "${name}.cabal.json" {} '' + jsonFile = pkgs.runCommandLocal "${name}.cabal.json" {} '' ${cabal2json}/bin/cabal2json ${file'} > $out ''; in @@ -31,7 +31,7 @@ in rec { # fromYaml IFD implementation fromYaml = file: let file' = l.path {path = file;}; - jsonFile = pkgs.runCommand "yaml.json" {} '' + jsonFile = pkgs.runCommandLocal "yaml.json" {} '' ${pkgs.yaml2json}/bin/yaml2json < ${file'} > $out ''; in @@ -54,7 +54,7 @@ in rec { fi ''; in - pkgs.runCommand "cabal-json-files" {} + pkgs.runCommandLocal "cabal-json-files" {} (l.concatStringsSep "\n" (l.map (c: convertOne c.name c.version) candidates)); diff --git a/src/subsystems/nodejs/builders/granular/default.nix b/src/subsystems/nodejs/builders/granular/default.nix index de4a4b21..00bb1ec3 100644 --- a/src/subsystems/nodejs/builders/granular/default.nix +++ b/src/subsystems/nodejs/builders/granular/default.nix @@ -8,7 +8,7 @@ mkShell, pkgs, python3, - runCommand, + runCommandLocal, stdenv, writeText, ... @@ -49,7 +49,7 @@ pkgs."nodejs-${builtins.toString nodejsVersion}_x" or (throw "Could not find nodejs version '${nodejsVersion}' in pkgs"); - nodeSources = runCommand "node-sources" {} '' + nodeSources = runCommandLocal "node-sources" {} '' tar --no-same-owner --no-same-permissions -xf ${nodejs.src} mv node-* $out ''; @@ -171,7 +171,7 @@ # Derivation building the ./node_modules directory in isolation. # This is used for the devShell of the current package. # We do not want to build the full package for the devShell. - nodeModulesDir = pkgs.runCommand "node_modules-${pname}" {} '' + nodeModulesDir = pkgs.runCommandLocal "node_modules-${pname}" {} '' # symlink direct dependencies to ./node_modules mkdir $out ${l.concatStringsSep "\n" ( diff --git a/src/subsystems/rust/builders/vendor.nix b/src/subsystems/rust/builders/vendor.nix index de7b7d1a..b96b2eb3 100644 --- a/src/subsystems/rust/builders/vendor.nix +++ b/src/subsystems/rust/builders/vendor.nix @@ -85,7 +85,7 @@ in rec { ${l.optionalString isGit "printf '{\"files\":{},\"package\":null}' > \"$out/${source.name}/.cargo-checksum.json\""} ''; in - pkgs.runCommand "vendor" {} '' + pkgs.runCommandLocal "vendor" {} '' mkdir -p $out ${ diff --git a/src/utils/default.nix b/src/utils/default.nix index 0c06cb08..ac000a64 100644 --- a/src/utils/default.nix +++ b/src/utils/default.nix @@ -10,7 +10,7 @@ nix, pkgs, python3, - runCommand, + runCommandLocal, stdenv, writeScript, writeScriptBin, @@ -72,13 +72,13 @@ in inherit (dreamLockUtils) readDreamLock; - toDrv = path: runCommand "some-drv" {} "cp -r ${path} $out"; + toDrv = path: runCommandLocal "some-drv" {} "cp -r ${path} $out"; toTOML = import ./toTOML.nix {inherit lib;}; # hash the contents of a path via `nix hash path` hashPath = algo: path: let - hashPath = runCommand "hash-${algo}" {} '' + hashPath = runCommandLocal "hash-${algo}" {} '' ${nix}/bin/nix --option experimental-features nix-command hash path ${path} | tr --delete '\n' > $out ''; in @@ -86,7 +86,7 @@ in # hash a file via `nix hash file` hashFile = algo: path: let - hashFile = runCommand "hash-${algo}" {} '' + hashFile = runCommandLocal "hash-${algo}" {} '' ${nix}/bin/nix --option experimental-features nix-command hash file ${path} | tr --delete '\n' > $out ''; in @@ -130,6 +130,7 @@ in ${coreutils}/bin/rm -rf $TMPDIR ''; + # TODO is this really needed? Seems to make builds slower, why not unpack + build? extractSource = { source, dir ? "", diff --git a/src/utils/external-dir.nix b/src/utils/external-dir.nix index 24f9dc9f..6503e57b 100644 --- a/src/utils/external-dir.nix +++ b/src/utils/external-dir.nix @@ -4,7 +4,7 @@ externalSources, externalPaths, }: -pkgs.runCommand "dream2nix-external-dir" {} +pkgs.runCommandLocal "dream2nix-external-dir" {} (lib.concatStringsSep "\n" (lib.mapAttrsToList (inputName: paths: