ci: sign and push Nix store paths to Cloudflare R2 cache #3

Merged
JakeHillion merged 1 commits from jj/lxyvnwmkyqst into main 2026-02-22 12:51:12 +00:00
2 changed files with 22 additions and 0 deletions

No files matched your search

+17
View File
@@ -12,6 +12,9 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: DeterminateSystems/nix-installer-action@c5a866b6ab867e88becbed4467b93592bce69f8a # v21
with:
extra-conf: |
accept-flake-config = true
- uses: nicknovitski/nix-develop@v1
with:
@@ -40,3 +43,17 @@ jobs:
- name: Flake check
run: nix flake check
- name: Sign and push to cache
if: always()
run: |
echo "$SIGNING_KEY" > /tmp/nix-signing-key
trap 'rm -f /tmp/nix-signing-key' EXIT
paths=$(nix path-info --all --json \
| jq -r 'to_entries[] | select(.value.ultimate == true) | .key')
echo "$paths" | xargs nix store sign --key-file /tmp/nix-signing-key
echo "$paths" | xargs nix copy --to 's3://jakehillion-nix?endpoint=https://28e45df51086264c6d9cf2b5e6ecc190.r2.cloudflarestorage.com&region=auto'
env:
SIGNING_KEY: ${{ secrets.NIX_SIGNING_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
+5
View File
@@ -1,6 +1,11 @@
{
description = "personal-agent";
nixConfig = {
extra-substituters = [ "https://nixcache.jakehillion.me" ];
extra-trusted-public-keys = [ "nixcache.jakehillion.me-1:HQsjYdrcs3ilS/ngtlbTQXU4Xfsm+va5NN7yoK0wKMg=" ];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";