diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-03-24 16:31:51 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-03-24 16:42:00 +0100 |
commit | d6ec410a471a5f26fcaaf8f4f440b41fe3f13738 (patch) | |
tree | 3104a0096e1a61046202b6d71ec77dfe6b3d054f /pkgs/top-level/make-tarball.nix | |
parent | 4ed98532a254f699243b7a8d9f4698604f03b3d3 (diff) |
Add packages.json to the tarball job
Moved from nixos-homepage.
Diffstat (limited to 'pkgs/top-level/make-tarball.nix')
-rw-r--r-- | pkgs/top-level/make-tarball.nix | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/pkgs/top-level/make-tarball.nix b/pkgs/top-level/make-tarball.nix index ff0b0568819c..23542e4afe0a 100644 --- a/pkgs/top-level/make-tarball.nix +++ b/pkgs/top-level/make-tarball.nix @@ -22,7 +22,7 @@ releaseTools.sourceTarball { then builtins.substring 0 8 nixpkgs.lastModified else toString nixpkgs.revCount}.${nixpkgs.shortRev or "dirty"}"; - buildInputs = [ nix.out jq lib-tests ]; + buildInputs = [ nix.out jq lib-tests pkgs.brotli ]; configurePhase = '' eval "$preConfigure" @@ -38,6 +38,8 @@ releaseTools.sourceTarball { doCheck = true; checkPhase = '' + set -o pipefail + export NIX_DB_DIR=$TMPDIR export NIX_STATE_DIR=$TMPDIR export NIX_PATH=nixpkgs=$TMPDIR/barf.nix @@ -83,12 +85,10 @@ releaseTools.sourceTarball { --show-trace --argstr system "$platform" \ -qa --drv-path --system-filter \* --system --meta --xml \ "''${opts[@]}" > /dev/null - stopNest done header "checking eval-release.nix" nix-instantiate --eval --strict --show-trace ./maintainers/scripts/eval-release.nix > /dev/null - stopNest header "checking find-tarballs.nix" nix-instantiate --readonly-mode --eval --strict --show-trace --json \ @@ -100,7 +100,16 @@ releaseTools.sourceTarball { echo "suspiciously low number of URLs" exit 1 fi - stopNest + + header "generating packages.json" + mkdir -p $out/nix-support + echo -n '{"version":2,"packages":' > tmp + nix-env -f . -I nixpkgs=${src} -qa --json --arg config 'import ${./packages-config.nix}' "''${opts[@]}" >> tmp + echo -n '}' >> tmp + packages=$out/packages.json.br + jq -c < tmp | brotli -9 > $packages + + echo "file json-br $packages" >> $out/nix-support/hydra-build-products ''; distPhase = '' |