pkgs: add substituteSubset
This commit is contained in:
parent
a26f97d3f3
commit
3a4ab51731
2 changed files with 29 additions and 0 deletions
|
@ -14,4 +14,6 @@ final: prev: {
|
|||
sim65 = final.callPackage ./sim65.nix { };
|
||||
|
||||
unbted = final.callPackage ./unbted.nix { };
|
||||
|
||||
substituteSubset = final.callPackage ./substitute-subset.nix { };
|
||||
}
|
||||
|
|
27
pkgs/substitute-subset.nix
Normal file
27
pkgs/substitute-subset.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ lib, stdenv }:
|
||||
|
||||
args:
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = if args ? name then args.name else baseNameOf (toString args.src);
|
||||
builder = builtins.toFile "builder.sh" ''
|
||||
source $stdenv/setup
|
||||
set -o pipefail
|
||||
|
||||
eval "$preInstall"
|
||||
|
||||
args=
|
||||
|
||||
cp -r "$src" "$out"
|
||||
|
||||
pushd "$out"
|
||||
echo -ne "${lib.concatStringsSep "\\0" args.files}" | xargs -0 -n1 -I {} -- find {} -type f -print0 | while read -d "" line; do
|
||||
substituteAllInPlace "$line"
|
||||
done
|
||||
popd
|
||||
|
||||
eval "$postInstall"
|
||||
'';
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
} // args)
|
Loading…
Add table
Add a link
Reference in a new issue