diff --git a/pkgs/build-support/src-only/default.nix b/pkgs/build-support/src-only/default.nix new file mode 100644 index 000000000000..a93b36480908 --- /dev/null +++ b/pkgs/build-support/src-only/default.nix @@ -0,0 +1,6 @@ +{stdenv, name, src, patches ? [], buildInputs ? [], ...}: +stdenv.mkDerivation { + inherit src buildInputs patches name; + installPhase = "cp -r . $out"; + phases = ["unpackPhase" "patchPhase" "installPhase"]; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 96ecb79f0a40..f4d1903b726e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -446,6 +446,8 @@ let linkFarm = name: entries: runCommand name {} ("mkdir -p $out; cd $out; \n" + (lib.concatMapStrings (x: "ln -s '${x.path}' '${x.name}';\n") entries)); + srcOnly = args: (import ../build-support/src-only) ({inherit stdenv; } // args); + substituteAll = import ../build-support/substitute/substitute-all.nix { inherit stdenv; };