the “check already built” script does not work for flakes

This commit is contained in:
Charlotte 🦝 Delenk 2022-11-16 16:14:47 +01:00
parent 8544e09f48
commit e1d5a64f69
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122

View file

@ -46,14 +46,6 @@ jobs:
run: sudo apt install jq
- name: Build ${{ matrix.host }}
run: |
DRV_PATH=$(nix-instantiate -E '((builtins.getFlake github:ursi/get-flake) ./.).hydraJobs.${{ matrix.host }}')
OUT_PATH=$(nix show-derivation $DRV_PATH | jq -r ".\"$DRV_PATH\".outputs.out.path")
# check if we already built it
NARINFO=$(echo $OUT_PATH | sed 's|/| |g' | sed 's|-| |g' | awk '{print $3}')
if curl --output /dev/null --silent --head --fail "https://cache.chir.rs/$NARINFO.narinfo"; then
echo "${{ matrix.host }} already built. Skipping"
else
nix-store -r $DRV_PATH
fi
nix build '.#hydraJobs.${{ matrix.host }}'
env:
NIXPKGS_ALLOW_UNFREE: 1