diff options
author | sefidel <contact@sefidel.net> | 2024-01-11 14:41:10 +0900 |
---|---|---|
committer | sefidel <contact@sefidel.net> | 2024-01-12 00:18:45 +0900 |
commit | 60747923348733085f7c7647ba304e75c096d80d (patch) | |
tree | 7915504a0dfacc153a27293b9bc2157dd2abfcd4 /modules/cachix | |
parent | a0e13034700e6a697c1adac3050702a1d3ba0ecd (diff) | |
download | infra-60747923348733085f7c7647ba304e75c096d80d.tar.gz infra-60747923348733085f7c7647ba304e75c096d80d.zip |
feat(modules, systems): don't implicitly activate modules
Diffstat (limited to 'modules/cachix')
-rw-r--r-- | modules/cachix/default.nix | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/cachix/default.nix b/modules/cachix/default.nix index 9dd55b5..5222457 100644 --- a/modules/cachix/default.nix +++ b/modules/cachix/default.nix @@ -1,5 +1,9 @@ { config, pkgs, lib, ... }: + +with lib; let + cfg = config.modules.cachix; + folder = ./caches; toImport = name: value: folder + ("/" + name); filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; @@ -7,7 +11,13 @@ let in { inherit imports; - nix.settings.substituters = [ "https://cache.nixos.org/" ]; - environment.systemPackages = [ pkgs.cachix ]; + options.modules.cachix = { + enable = mkEnableOption "cachix"; + }; + + config = mkIf cfg.enable { + nix.settings.substituters = [ "https://cache.nixos.org/" ]; + environment.systemPackages = [ pkgs.cachix ]; + }; } |