workflow: install attic instead of nix run

This commit is contained in:
cy 2025-03-13 17:15:53 -04:00
parent ffcb42f833
commit 2b5322cb72
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts
2 changed files with 9 additions and 6 deletions

View file

@ -66,7 +66,8 @@ jobs:
- name: setup attic - name: setup attic
run: | run: |
nix run github:zhaofengli/attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN" nix profile install github:zhaofengli/attic
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- run: | - run: |
nix build -L .#nixosConfigurations.${{ matrix.machine }}.config.system.build.toplevel nix build -L .#nixosConfigurations.${{ matrix.machine }}.config.system.build.toplevel
@ -75,7 +76,7 @@ jobs:
run: | run: |
derivation="$(nix path-info --derivation "${{ matrix.machine }}")" derivation="$(nix path-info --derivation "${{ matrix.machine }}")"
cache="$(nix-store --query --requisites --include-outputs "$derivation")" cache="$(nix-store --query --requisites --include-outputs "$derivation")"
nix run github:zhaofengli/attic push main --stdin <<< "$cache" attic push main --stdin <<< "$cache"
- name: prepare tarball to upload - name: prepare tarball to upload
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
@ -137,7 +138,8 @@ jobs:
- name: setup attic - name: setup attic
run: | run: |
nix run github:zhaofengli/attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN" nix profile install github:zhaofengli/attic
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- run: | - run: |
package=".#homeConfigurations."${{ matrix.home }}".activationPackage" package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
@ -147,7 +149,7 @@ jobs:
run: | run: |
derivation="$(nix path-info --derivation "$package")" derivation="$(nix path-info --derivation "$package")"
cache="$(nix-store --query --requisites --include-outputs "$derivation")" cache="$(nix-store --query --requisites --include-outputs "$derivation")"
nix run github:zhaofengli/attic push main --stdin <<< "$cache" attic push main --stdin <<< "$cache"
- name: prepare tarball to upload - name: prepare tarball to upload
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result

View file

@ -42,7 +42,8 @@ jobs:
- name: setup attic - name: setup attic
run: | run: |
nix run github:zhaofengli/attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN" nix profile install github:zhaofengli/attic
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- run: nix build -L ${{ matrix.package }} - run: nix build -L ${{ matrix.package }}
@ -50,7 +51,7 @@ jobs:
run: | run: |
derivation="$(nix path-info --derivation "${{ matrix.package }}")" derivation="$(nix path-info --derivation "${{ matrix.package }}")"
cache="$(nix-store --query --requisites --include-outputs "$derivation")" cache="$(nix-store --query --requisites --include-outputs "$derivation")"
nix run github:zhaofengli/attic push main --stdin <<< "$cache" attic push main --stdin <<< "$cache"
- name: prepare tarball to upload - name: prepare tarball to upload
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result