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

28 lines
478 B
Nix
Raw Permalink Normal View History

2024-12-06 18:04:47 +00:00
{
config,
lib,
namespace,
...
}:
2024-02-29 14:53:34 +00:00
let
2024-12-06 18:04:47 +00:00
cfg = config.${namespace}.services.apcupsd;
2024-02-29 14:53:34 +00:00
in
{
options = {
2024-12-06 18:04:47 +00:00
${namespace}.services.apcupsd = {
2024-08-02 21:55:48 +00:00
enable = lib.mkEnableOption "Enables apcupsd";
configText = lib.mkOption {
type = lib.types.str;
description = "The configuration to pass to apcupsd.";
};
};
};
2024-02-29 14:53:34 +00:00
2024-08-02 21:55:48 +00:00
config = lib.mkIf cfg.enable {
services.apcupsd = {
enable = true;
configText = cfg.configText;
};
};
}