{ config, inputs, lib, pkgs, ... }: let cfg = config.myOptions.programs.nh; inherit (lib.modules) mkEnableOption mkIf mkOption; inherit (lib.types) str; in { options.myOptions.programs.nh = { enable = mkEnableOption "nh"; flake = mkOption { type = str; description = "flake directory"; }; }; config = mkIf cfg.enable { programs.nh = { enable = true; package = inputs.nh.packages.${pkgs.system}.default; inherit (cfg) flake; clean = { enable = true; dates = "weekly"; extraArgs = "--keep 10"; }; }; }; }