19 lines
453 B
Nix
19 lines
453 B
Nix
# rebase is a helper which takes all files/dirs under oldroot, and
|
|
# creates a new derivation with those files/dirs copied under newroot
|
|
# (where newroot is a relative path to the root of the derivation).
|
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
}: name: oldroot: newroot: stdenv.mkDerivation {
|
|
|
|
inherit name oldroot newroot;
|
|
|
|
builder = builtins.toFile "builder.sh" ''
|
|
source $stdenv/setup
|
|
mkdir -p "$out"/"$newroot"
|
|
cp -rL "$oldroot"/* "$out"/"$newroot"
|
|
'';
|
|
}
|