mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-16 23:29:23 +08:00
21 lines
710 B
Nix
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; })
|
|
];
|
|
}
|