diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/channel.nix | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/pkgs/build-support/channel.nix b/pkgs/build-support/channel.nix index a837177f..d5cc74e7 100644 --- a/pkgs/build-support/channel.nix +++ b/pkgs/build-support/channel.nix @@ -1,32 +1,36 @@ { stdenv }: -{ name, src, constituents ? [], meta ? {}, ... }@args: +{ name, src, constituents ? [], ... }@args: -stdenv.mkDerivation ({ - inherit name src constituents; - preferLocalBuild = true; - _hydraAggregate = true; +let + channel = stdenv.mkDerivation ({ + inherit name src constituents; + preferLocalBuild = true; + _hydraAggregate = true; - phases = [ "unpackPhase" "patchPhase" "installPhase" ]; - installPhase = '' - mkdir -p "$out/tarballs" "$out/nix-support" + phases = [ "unpackPhase" "patchPhase" "installPhase" ]; + installPhase = '' + mkdir -p "$out/tarballs" "$out/nix-support" - tar cJf "$out/tarballs/nixexprs.tar.xz" \ - --owner=0 --group=0 --mtime="1970-01-01 00:00:00 UTC" \ - --transform='s!^\.!${name}!' . + tar cJf "$out/tarballs/nixexprs.tar.xz" \ + --owner=0 --group=0 --mtime="1970-01-01 00:00:00 UTC" \ + --transform='s!^\.!${name}!' . - echo "channel - $out/tarballs/nixexprs.tar.xz" \ - > "$out/nix-support/hydra-build-products" + echo "channel - $out/tarballs/nixexprs.tar.xz" \ + > "$out/nix-support/hydra-build-products" - echo $constituents > "$out/nix-support/hydra-aggregate-constituents" - for i in $constituents; do - if [ -e "$i/nix-support/failed" ]; then - touch "$out/nix-support/failed" - fi - done - ''; - - meta = meta // { + echo $constituents > "$out/nix-support/hydra-aggregate-constituents" + for i in $constituents; do + if [ -e "$i/nix-support/failed" ]; then + touch "$out/nix-support/failed" + fi + done + ''; + } // removeAttrs args [ "name" "channelName" "src" "constituents" ]); +in channel // { + # XXX: We're adding meta.isHydraChannel outside of mkDerivation to avoid a + # typecheck on meta since it doesn't include isHydraChannel. + meta = (channel.meta or {}) // { isHydraChannel = true; }; -} // removeAttrs args [ "name" "channelName" "src" "constituents" "meta" ]) +} |