From 04d77743abdd66b00921290cf70274679a7eb709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=A4nner?= Date: Sat, 28 Dec 2024 22:07:14 +0100 Subject: [PATCH] add binary caches --- modules/nixos/cache.nix | 20 ++++++++++++++++++++ modules/nixos/default.nix | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 modules/nixos/cache.nix diff --git a/modules/nixos/cache.nix b/modules/nixos/cache.nix new file mode 100644 index 0000000..7f55c06 --- /dev/null +++ b/modules/nixos/cache.nix @@ -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=" + ]; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 1ae01cf..4b7ca9e 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -5,7 +5,7 @@ }: let cfg = config.myConfig; 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 = { enable = lib.mkEnableOption "my custom config"; @@ -17,6 +17,7 @@ in { bootloader.enable = true; locale.enable = true; rebuild.enable = true; + cache.enable = true; greetd.enable = lib.mkIf cfg.desktop true; sway.enable = lib.mkIf cfg.desktop true;