1
0
Fork 0
nix-configuration/modules/nixos/services/apcupsd/default.nix

28 lines
478 B
Nix

{
config,
lib,
namespace,
...
}:
let
cfg = config.${namespace}.services.apcupsd;
in
{
options = {
${namespace}.services.apcupsd = {
enable = lib.mkEnableOption "Enables apcupsd";
configText = lib.mkOption {
type = lib.types.str;
description = "The configuration to pass to apcupsd.";
};
};
};
config = lib.mkIf cfg.enable {
services.apcupsd = {
enable = true;
configText = cfg.configText;
};
};
}