add binary caches

This commit is contained in:
Max Känner 2024-12-28 22:07:14 +01:00
parent e520257894
commit 04d77743ab
2 changed files with 22 additions and 1 deletions

20
modules/nixos/cache.nix Normal file
View File

@ -0,0 +1,20 @@
{
lib,
config,
...
}: let
cfg = config.myConfig.cache;
in {
options.myConfig.cache = {
enable = lib.mkEnableOption "extra binary caches";
};
config = lib.mkIf cfg.enable {
nix.settings = {
substituters = ["https://nix-community.cachix.org"];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
};
}

View File

@ -5,7 +5,7 @@
}: let }: let
cfg = config.myConfig; cfg = config.myConfig;
in { in {
imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix ./touch.nix]; imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix ./touch.nix ./cache.nix];
options.myConfig = { options.myConfig = {
enable = lib.mkEnableOption "my custom config"; enable = lib.mkEnableOption "my custom config";
@ -17,6 +17,7 @@ in {
bootloader.enable = true; bootloader.enable = true;
locale.enable = true; locale.enable = true;
rebuild.enable = true; rebuild.enable = true;
cache.enable = true;
greetd.enable = lib.mkIf cfg.desktop true; greetd.enable = lib.mkIf cfg.desktop true;
sway.enable = lib.mkIf cfg.desktop true; sway.enable = lib.mkIf cfg.desktop true;