Files
nixos/modules/services/default.nix
2024-10-27 00:31:38 +08:00

21 lines
710 B
Nix

inputs:
{
imports = inputs.localLib.findModules ./.;
options.nixos.services = let inherit (inputs.lib) mkOption types; in
{
smartd.enable = mkOption { type = types.bool; default = false; };
noisetorch.enable = mkOption { type = types.bool; default = inputs.config.nixos.model.type == "desktop"; };
};
config =
let
inherit (inputs.lib) mkMerge mkIf;
inherit (inputs.localLib) stripeTabs attrsToList;
inherit (inputs.config.nixos) services;
inherit (builtins) map listToAttrs toString;
in mkMerge
[
(mkIf services.smartd.enable { services.smartd.enable = true; })
(mkIf services.noisetorch.enable { programs.noisetorch.enable = true; })
];
}