Performance
cache
Configure caches to read, and optionally a Cachix cache for reading and writting.
Types:
- cache:
- extra: (attrsOf cacheExtra)
- readNixos (
bool
): Optional. Set totrue
in order to add https://cache.nixos.org as a read cache. Defaults totrue
.
- cacheExtra:
- enable (
str
): Read from cache. is read on the server. - pubKey (
str
): Public key of the cache server. - token (
str
): The name of the environment variable that contains the token to push the cache. - type: (
enum [cachix]
): Binary cache type. Can be Cachix. - url (
str
): URL of the cache. - write (
bool
): Enable pushing derivations to the cache. Requirestoken
.
- enable (
Required environment variables:
CACHIX_AUTH_TOKEN
: API token of the Cachix cache.- For Public caches: If not set the cache will be read, but not written to.
- For private caches: If not set the cache won't be read, nor written to.
Example:
Configuring trusted-users
If you decided to go with a Multi-user installation when installing Nix, you will have to take additional steps in order to make the cache work.
As the Multi-user installation
does not trust your user by default,
you will have to add yourself
to the trusted-users
in the
Nix Configuration File.