Skip to content

Commit

Permalink
push is working, reads is working as well, need to sign packages now
Browse files Browse the repository at this point in the history
  • Loading branch information
b-rodrigues committed Nov 9, 2024
1 parent 59d6786 commit bb2f2bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push_to_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
contents: read

jobs:
devtools:
build-and-push:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 8 additions & 1 deletion how_to.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ Steps:
- Set up `s3cmd` using `s3cmd --configure` by follow instructions here: https://docs.digitalocean.com/products/spaces/reference/s3cmd/
- Learn about common `s3cmd` here: https://docs.digitalocean.com/products/spaces/reference/s3cmd-usage/ and here: https://s3tools.org/usage
- Set up the bucket policy for unauthenticated reads: https://nix.dev/manual/nix/2.23/store/types/s3-binary-cache-store by first saving the contents into `policy.json` and then calling `s3cmd setpolicy policy.json s3://your-bucket-here`
- Then set up the bucket policy for authenticated puts from the same page as before: `s3cmd setpolicy policy_puts.json s3://your-bucket-here`
- Then set up the bucket policy for non-authenticated reads from the same page as before: `s3cmd setpolicy policy.json s3://your-bucket-here`
- Check if policy is set correctly: `echo -e $(aws s3api get-bucket-policy --bucket rstats-on-nix-cache --profile digitalocean --endpoint-url https://fra1.digitaloceanspaces.com)`
- Build the lolhello package from: https://fzakaria.com/2020/07/15/setting-up-a-nix-s3-binary-cache.html
- Push the lolhello package: `nix copy $(nix-store --query --requisites --include-outputs $(nix-store --query --deriver ./result)) --to 's3://rstats-on-nix-cache?profile=digitalocean&scheme=https&endpoint=fra1.digitaloceanspaces.com' --option narinfo-cache-positive-ttl 0`


Resources:

https://fzakaria.com/2020/07/15/setting-up-a-nix-s3-binary-cache.html
https://jcollie.github.io/nixos/2022/04/27/nixos-binary-cache-2022.html
https://web.archive.org/web/20210121024158/https://fmnxl.com/blog/setting-up-nix-binary-cache/

0 comments on commit bb2f2bf

Please sign in to comment.