diff --git a/hosts/common/common.nix b/hosts/common/common.nix index 1517d9b..11518bc 100644 --- a/hosts/common/common.nix +++ b/hosts/common/common.nix @@ -13,6 +13,8 @@ smayzy.virt.enable = true; + smayzy.nh.enable = true; + users.users.smayzy = { isNormalUser = true; description = "smayzy"; diff --git a/modules/nix/nh.nix b/modules/nix/nh.nix index 9483019..f277738 100644 --- a/modules/nix/nh.nix +++ b/modules/nix/nh.nix @@ -1,9 +1,20 @@ { config, lib, pkgs, ...}: +let + inherit (lib) mkIf mkOption types; +in { -programs.nh = { - enable = true; - clean.enable = true; - clean.extraArgs = "--keep 10"; - flake = "/home/smayzy/nix-config"; + options.smayzy.nh.enable = mkOption { + type = types.bool; + default = false; + description = "use nh"; + }; + + config = mkIf config.smayzy.nh.enable { + programs.nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep 10"; + flake = "/home/smayzy/nix-config"; + }; }; }