From bfca6f8735dde2f84fc9fd683d78e4eaedb5b273 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Mon, 13 Jan 2025 18:58:20 -0800 Subject: [PATCH] feat(nixos): Enable nh garbage collection --- modules/nixos/programs/nh/default.nix | 20 ++++++++++++++++++++ systems/x86_64-linux/nyx/default.nix | 1 + 2 files changed, 21 insertions(+) create mode 100644 modules/nixos/programs/nh/default.nix diff --git a/modules/nixos/programs/nh/default.nix b/modules/nixos/programs/nh/default.nix new file mode 100644 index 0000000..2eb7584 --- /dev/null +++ b/modules/nixos/programs/nh/default.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + ... +}: let + cfg = config.marleyos.programs.nh; +in { + options.marleyos.programs.nh.enable = lib.mkEnableOption "nh"; + + config = lib.mkIf cfg.enable { + programs.nh = { + enable = true; + clean = { + enable = true; + dates = "daily"; + extraArgs = "--keep-since 7d --keep 3"; + }; + }; + }; +} diff --git a/systems/x86_64-linux/nyx/default.nix b/systems/x86_64-linux/nyx/default.nix index f495fdd..7855865 100644 --- a/systems/x86_64-linux/nyx/default.nix +++ b/systems/x86_64-linux/nyx/default.nix @@ -20,6 +20,7 @@ in { programs = { fish = enabled; + nh = enabled; }; services = {