refactor
This commit is contained in:
parent
2e69313a12
commit
9591374838
9 changed files with 7 additions and 14 deletions
21
README.md
21
README.md
|
@ -59,20 +59,13 @@ And... that's basically all you need.
|
||||||
|
|
||||||
### A NixOS builder with local cache
|
### A NixOS builder with local cache
|
||||||
|
|
||||||
The nix builder will create a local cache on your node agent at `/var/cache/albatros`.
|
In the `hcl/` folder, you will find the definition of a builder named `nixcache`.
|
||||||
It will create two folders: `/var/cache/albatros/nix` that contains a nix store,
|
This builder has the following features:
|
||||||
and `/var/cache/albatros/cacheroot` that contains nix roots, ie. the builds we must keep.
|
- It creates a persisted nix store at `/var/cache/albatros` on your host if it does not exist yet.
|
||||||
|
- The nix store is mounted read-only during the build
|
||||||
Caching is handled thanks to these roots: roots that are older than 7 days will be removed,
|
- A nix daemon is run in a separate container, you can interact with it though its unix socket (everything is already setup for you). Simply run `nix build`.
|
||||||
then a garbage collection will be triggered, and their associate content will be deleted.
|
- All your builds are automatically added as a nix gcroots by the nix daemon, `keep_derivation` is activated so your build dependencies are kept locally.
|
||||||
|
- At the end, all gcroots older than 7 days are deleted, and then the `nix store gc` is called effectively wiping data that were previously attached to old gcroots.
|
||||||
To keep your cache between builds, you must put your outlink in `/mnt/cacheroot` with a unique name.
|
|
||||||
The git commit is a good candidate:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# create an output link at a persisted path
|
|
||||||
nix build --out-link $GCROOT
|
|
||||||
```
|
|
||||||
|
|
||||||
## Register a build
|
## Register a build
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue