Skip to content

Instantly share code, notes, and snippets.

@LnL7
Created August 17, 2017 19:50
Show Gist options
  • Save LnL7/0ae08f43c7e6854531311cfce8c31b17 to your computer and use it in GitHub Desktop.
Save LnL7/0ae08f43c7e6854531311cfce8c31b17 to your computer and use it in GitHub Desktop.
with import ./. {};
stdenv.mkDerivation {
name = "foo";
buildInputs = [ nixUnstable ];
unpackPhase = ":";
buildPhase = ''
readlink -f $(type -P nix-store)
export HOME=$NIX_BUILD_TOP/ROOT/home/foo
export NIX_REMOTE=local?root=$NIX_BUILD_TOP/ROOT
nix-store --add ${stdenv} ${hello.src}
nix-instantiate ${./.} -A hello
nix-store -r $(nix-instantiate ${./.} -A hello) --option build-use-substitutes false
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment