Skip to content

Commit

Permalink
Test: switch to Attic
Browse files Browse the repository at this point in the history
  • Loading branch information
42LoCo42 committed May 23, 2024
1 parent ecbe2df commit a0aa272
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
substituters = https://42loco42.cachix.org https://cache.nixos.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= 42loco42.cachix.org-1:6HvWFER3RdTSqEZDznqahkqaoI6QCOiX2gRpMMsThiQ=
substituters = https://cache.nixos.org https://42loco42.cachix.org https://attic.eleonora.gay/default
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= 42loco42.cachix.org-1:6HvWFER3RdTSqEZDznqahkqaoI6QCOiX2gRpMMsThiQ= default:XPg5h4CW7EI+JTHIwsCTDSw+KxNHQoujFcUoc7a0mDQ=
- name: Run CI
run: nix run .#ci
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
18 changes: 9 additions & 9 deletions .github/workflows/nvidia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ jobs:
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
substituters = https://42loco42.cachix.org https://cache.nixos.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= 42loco42.cachix.org-1:6HvWFER3RdTSqEZDznqahkqaoI6QCOiX2gRpMMsThiQ=
substituters = https://cache.nixos.org https://42loco42.cachix.org https://attic.eleonora.gay/default
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= 42loco42.cachix.org-1:6HvWFER3RdTSqEZDznqahkqaoI6QCOiX2gRpMMsThiQ= default:XPg5h4CW7EI+JTHIwsCTDSw+KxNHQoujFcUoc7a0mDQ=
- name: Update, build, push
run: |
old="$(sha256sum flake.lock)"
nix flake update nixpkgs-new
new="$(sha256sum flake.lock)"
# old="$(sha256sum flake.lock)"
# nix flake update nixpkgs-new
# new="$(sha256sum flake.lock)"
if [ "$old" != "$new" ]; then
# if [ "$old" != "$new" ]; then
nix run -L .#nvidia
fi
# fi
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}

- name: Commit flake updates
uses: planetscale/[email protected]
Expand All @@ -42,4 +42,4 @@ jobs:
repo: ${{ github.repository }}
branch: ${{ github.head_ref || github.ref_name }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 10 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,17 @@

ci = pkgs.writeShellApplication {
name = "ci";
runtimeInputs = with pkgs; [
cachix
jq
nix-eval-jobs
];
runtimeInputs = with pkgs; [ attic-client jq nix-eval-jobs ];
text = ''
attic login eleonora https://attic.eleonora.gay "$ATTIC_TOKEN"
nix-eval-jobs \
--check-cache-status \
--force-recurse \
--workers "$(nproc)" \
--flake .#packages.${pkgs.system} \
| jq -r 'if .isCached then empty else .drvPath end' \
| xargs -P "$(nproc)" -I% nix-store --realise % \
| cachix push 42loco42
| tee /dev/stderr \
| xargs attic push default
'';
};

Expand All @@ -189,7 +186,11 @@
name = "nvidia";
runtimeInputs = with pkgs; [ cachix ];
text = ''
realpath ${out}/* | tee /dev/stderr | cachix push 42loco42
attic login eleonora https://attic.eleonora.gay "$ATTIC_TOKEN"
realpath ${out}/* \
| tee /dev/stderr \
| xargs attic push default
'';
};
}
Expand Down

0 comments on commit a0aa272

Please sign in to comment.