From 60747923348733085f7c7647ba304e75c096d80d Mon Sep 17 00:00:00 2001 From: sefidel Date: Thu, 11 Jan 2024 14:41:10 +0900 Subject: feat(modules, systems): don't implicitly activate modules --- modules/cachix/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'modules/cachix') 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 ]; + }; } -- cgit 1.4.1