From 084983e1e11a005b9cf71c61e51f916ee5973c36 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Sat, 1 Feb 2025 22:57:04 +0100 Subject: [PATCH] Move nh config to a module. --- hosts/nixos/home.nix | 10 ---------- modules/home-manager/default.nix | 2 ++ modules/home-manager/nh.nix | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 modules/home-manager/nh.nix diff --git a/hosts/nixos/home.nix b/hosts/nixos/home.nix index b51aff4..027646c 100644 --- a/hosts/nixos/home.nix +++ b/hosts/nixos/home.nix @@ -28,16 +28,6 @@ # Install librewolf programs.librewolf.enable = true; - # Install nh - programs.nh = { - enable = true; - flake = "/home/crony/Repos/nixos"; - clean = { - enable = true; - extraArgs = "--keep 5 --keep-since 3d"; - }; - }; - # Install foot programs.foot.enable = true; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 2a56b32..39209ad 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -7,6 +7,7 @@ ./nnn.nix ./mpv.nix ./obs-studio.nix + ./nh.nix ]; crony.mangohud.enable = lib.mkDefault true; @@ -16,4 +17,5 @@ crony.nnn.enable = lib.mkDefault true; crony.mpv.enable = lib.mkDefault true; crony.obs-studio.enable = lib.mkDefault true; + crony.nh.enable = lib.mkDefault true; } diff --git a/modules/home-manager/nh.nix b/modules/home-manager/nh.nix new file mode 100644 index 0000000..a2275dd --- /dev/null +++ b/modules/home-manager/nh.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + ... +}: { + options = { + crony.nh.enable = lib.mkEnableOption "Enable nh and set it up for automatic cleaning."; + }; + + config = lib.mkIf config.crony.nh.enable { + # Install nh + programs.nh = { + enable = true; + flake = "/home/crony/Repos/nixos"; + clean = { + enable = true; + extraArgs = "--keep 5 --keep-since 3d"; + }; + }; + }; +}