Crates.io | nix-cache-watcher |
lib.rs | nix-cache-watcher |
version | 0.0.7 |
source | src |
created_at | 2022-09-13 04:27:34.749903 |
updated_at | 2022-09-17 06:51:21.696769 |
description | Upload new nix artifacts to an s3-compatible binary cache |
homepage | |
repository | https://sr.ht/~thatonelutenist/nix-cache-watcher |
max_upload_size | |
id | 664236 |
size | 117,726 |
A very WIP tool for uploading Nix build artifacts to an s3 compatible binary cache. This will eventually support direct upload to s3/b2, and possibly direct singing, but at the moment it shells out to the nix to perform those operations.
Takes a snapshot of your nix store state before your build, and then signs and uploads new installable afterwards.
This program is only intended to run on systems with nix
installed, and has the following
dependencies:
xz
curl
Install though cargo:
cargo install nix-cache-watcher
or through Nix:
nix registry add nix-cache-watcher 'git+https://git.sr.ht/~thatonelutenist/nix-cache-watcher?ref=trunk'
nix build nix-cache-watcher# --profile /home/build/.nix-profile
See nix-cache-watcher --help
for full syntax and options.
Before starting your build, you must take a snapshot of the current nix store state:
nix-cache-watcher save-store
Then, run your build. After your build completes, first sign the new store paths, and then send them off for upload:
nix-cache-watcher sign-store -k $PATH_TO_KEY
nix-cache-watcher upload-diff -r "$CACHE_URI" -v
Note: you must already have your AWS SDK credentials configured for this to work.