mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 07:29:23 +08:00
23 lines
755 B
Nix
23 lines
755 B
Nix
inputs:
|
|
{
|
|
imports = inputs.localLib.findModules ./.;
|
|
options.nixos.services = let inherit (inputs.lib) mkOption types; in
|
|
{
|
|
smartd = mkOption
|
|
{
|
|
type = types.nullOr (types.submodule {});
|
|
default = if builtins.elem inputs.config.nixos.model.type [ "desktop" "server" ] then {} else null;
|
|
};
|
|
noisetorch = mkOption
|
|
{
|
|
type = types.nullOr (types.submodule {});
|
|
default = if inputs.config.nixos.model.type == "desktop" then {} else null;
|
|
};
|
|
};
|
|
config = let inherit (inputs.config.nixos.services) smartd noisetorch; in inputs.lib.mkMerge
|
|
[
|
|
(inputs.lib.mkIf (smartd != null) { services.smartd.enable = true; })
|
|
(inputs.lib.mkIf (noisetorch != null) { programs.noisetorch.enable = true; })
|
|
];
|
|
}
|