diff options
Diffstat (limited to 'modules/cachix/default.nix')
-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 ]; + }; } |