Skip to content

Instantly share code, notes, and snippets.

@adnelson
Last active September 18, 2015 15:46
Show Gist options
  • Save adnelson/fc1e46392e99a310dafe to your computer and use it in GitHub Desktop.
Save adnelson/fc1e46392e99a310dafe to your computer and use it in GitHub Desktop.
source $stdenv/setup
echo test1 > $out
export FOO=BAR
echo "FOO from d1 is: $FOO"
source $stdenv/setup
echo "FOO is: $FOO" | tee $out
let
pkgs = import <nixpkgs> {};
in
let
d1 = derivation {
inherit (pkgs) stdenv;
name = "d1";
src = ./.;
system = builtins.currentSystem;
builder = ./builder1.sh;
buildInputs = [pkgs.python];
};
d2 = derivation {
inherit (pkgs) stdenv;
name = "d2";
src = ./.;
system = builtins.currentSystem;
builder = ./builder2.sh;
buildInputs = [d1];
};
in
d2
$ nix-build default.nix
these derivations will be built:
/nix/store/vgjnvg6sw4gpq5ngvamnrvi3v6sgb2kw-d1.drv
/nix/store/4a00ylk9d2br5z4lcqzccnplxs4srqhc-d2.drv
building path(s) ‘/nix/store/n61rcbzw49i7v5kf7sgrlw0q6rqnj7iy-d1’
while setting up the build environment: executing ‘/nix/store/ffliclfpnpkjllxbn96awgmb7wasid44-builder1.sh’: Exec format error
builder for ‘/nix/store/vgjnvg6sw4gpq5ngvamnrvi3v6sgb2kw-d1.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/4a00ylk9d2br5z4lcqzccnplxs4srqhc-d2.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/4a00ylk9d2br5z4lcqzccnplxs4srqhc-d2.drv’ failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment