Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonascarpay/declarative-cachix
Manage cachix caches declaratively
https://github.com/jonascarpay/declarative-cachix
nix
Last synced: 3 days ago
JSON representation
Manage cachix caches declaratively
- Host: GitHub
- URL: https://github.com/jonascarpay/declarative-cachix
- Owner: jonascarpay
- Created: 2021-01-27T21:28:02.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-23T11:55:27.000Z (about 1 year ago)
- Last Synced: 2024-10-31T15:52:46.883Z (10 days ago)
- Topics: nix
- Language: Nix
- Homepage:
- Size: 32.2 KB
- Stars: 33
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Declarative Cachix
Add [cachix](https://cachix.org/) caches declaratively.
You can use it either as a system module, or as a home-manager module.### System module
Import `default.nix` into your system configuration.
This adds the top-level `cachix` option, which you can use to add cachix caches.
You can either pass them as names, or as `{name, sha256}` attribute pairs.Example configuration:
```nix
{
imports = [
(import (builtins.fetchTarball "https://github.com/jonascarpay/declarative-cachix/archive/a2aead56e21e81e3eda1dc58ac2d5e1dc4bf05d7.tar.gz"))
];cachix = [
{ name = "jmc"; sha256 = "1bk08lvxi41ppvry72y1b9fi7bb6qvsw6bn1ifzsn46s3j0idq0a"; }
"iohk"
];
}
```### Home-manager module
#### Usage
Import `home-manager.nix` into your home-manager configuration.
This adds two user-facing options; `caches.extraCaches` and `caches.cachix`.Note that you need to be a trusted user to be able to specify caches.
See [this issue](https://github.com/jonascarpay/declarative-cachix/issues/2) for more information.Example configuration:
```nix
{
imports = [
(
let
declCachix = builtins.fetchTarball "https://github.com/jonascarpay/declarative-cachix/archive/a2aead56e21e81e3eda1dc58ac2d5e1dc4bf05d7.tar.gz";
in import "${declCachix}/home-manager.nix"
)
];caches.cachix = [
{ name = "jmc"; sha256 = "1bk08lvxi41ppvry72y1b9fi7bb6qvsw6bn1ifzsn46s3j0idq0a"; }
"nix-community"
];caches.extraCaches = [
{
url = "https://hydra.iohk.io";
key = "hydra.iohk.io:********************************************";
}
];
}
```#### Experimental
There is a `home-manager-experimental.nix` module that uses the `extra-substituters` and `extra-trusted-public-keys` configuration fields, instead of the normal `substituters` and `trusted-public-keys`.
These fields compose better and have less risk of accidentally overriding other configuration, but unfortunately they are not yet available in stable nix.If you're on unstable and have enabled experimental features, and you're having issues where your caches are not properly being picked up, consider switching to this module.
It takes the same options as the normal module.