Skip to content

Instantly share code, notes, and snippets.

@infinisil
Created January 4, 2018 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infinisil/70b376ef310a3b6371a6fd445d2b00a1 to your computer and use it in GitHub Desktop.
Save infinisil/70b376ef310a3b6371a6fd445d2b00a1 to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
let
# an arbitrary derivation with some files in $out
foo = runCommand "foo" {} ''
mkdir $out
echo a > $out/a
echo b > $out/b
echo c > $out/c
'';
bar = runCommand "bar" {} ''
mkdir $out
# link everything from foo to bar
ln -vs ${foo}/* $out
# but change one file
rm $out/b
echo newb > $out/b
'';
in bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment