home: nix: add 'cache.selfHosted'
All checks were successful
ci/woodpecker/push/check Pipeline was successful

Once again mirroring the NixOS module changes that I forgot to port
over.
This commit is contained in:
Bruno BELANYI 2024-02-12 11:40:09 +00:00
parent 7f17069998
commit 0bb2be6b87

View file

@ -22,6 +22,10 @@ in
options.my.home.nix = with lib; {
enable = my.mkDisableOption "nix configuration";
cache = {
selfHosted = my.mkDisableOption "self-hosted cache";
};
inputs = {
link = my.mkDisableOption "link inputs to `/etc/nix/inputs/`";
@ -56,6 +60,22 @@ in
};
}
(lib.mkIf cfg.cache.selfHosted {
nix = {
settings = {
# The NixOS module adds the official Hydra cache by default
# No need to use `extra-*` options.
substituters = [
"https://cache.belanyi.fr/"
];
trusted-public-keys = [
"cache.belanyi.fr:LPhrTqufwfxTceg1nRWueDWf7/2zSVY9K00pq2UI7tw="
];
};
};
})
(lib.mkIf cfg.inputs.addToRegistry {
nix.registry =
let