nixos/unifi-poller: rename to unpoller.

This commit is contained in:
Luke Granger-Brown 2022-11-24 15:30:14 +00:00
parent 40ddf3e2c6
commit ffcd97b521
2 changed files with 16 additions and 12 deletions

View File

@ -724,7 +724,7 @@
./services/monitoring/thanos.nix
./services/monitoring/tremor-rs.nix
./services/monitoring/tuptime.nix
./services/monitoring/unifi-poller.nix
./services/monitoring/unpoller.nix
./services/monitoring/ups.nix
./services/monitoring/uptime.nix
./services/monitoring/vmagent.nix

View File

@ -3,15 +3,19 @@
with lib;
let
cfg = config.services.unifi-poller;
cfg = config.services.unpoller;
configFile = pkgs.writeText "unifi-poller.json" (generators.toJSON {} {
configFile = pkgs.writeText "unpoller.json" (generators.toJSON {} {
inherit (cfg) poller influxdb loki prometheus unifi;
});
in {
options.services.unifi-poller = {
enable = mkEnableOption (lib.mdDoc "unifi-poller");
imports = [
(lib.mkRenamedOptionModule [ "services" "unifi-poller" ] [ "services" "unpoller" ])
];
options.services.unpoller = {
enable = mkEnableOption (lib.mdDoc "unpoller");
poller = {
debug = mkOption {
@ -86,8 +90,8 @@ in {
};
pass = mkOption {
type = types.path;
default = pkgs.writeText "unifi-poller-influxdb-default.password" "unifipoller";
defaultText = literalExpression "unifi-poller-influxdb-default.password";
default = pkgs.writeText "unpoller-influxdb-default.password" "unifipoller";
defaultText = literalExpression "unpoller-influxdb-default.password";
description = lib.mdDoc ''
Path of a file containing the password for influxdb.
This file needs to be readable by the unifi-poller user.
@ -135,8 +139,8 @@ in {
};
pass = mkOption {
type = types.path;
default = pkgs.writeText "unifi-poller-loki-default.password" "";
defaultText = "unifi-poller-influxdb-default.password";
default = pkgs.writeText "unpoller-loki-default.password" "";
defaultText = "unpoller-influxdb-default.password";
description = lib.mdDoc ''
Path of a file containing the password for Loki.
This file needs to be readable by the unifi-poller user.
@ -184,8 +188,8 @@ in {
};
pass = mkOption {
type = types.path;
default = pkgs.writeText "unifi-poller-unifi-default.password" "unifi";
defaultText = literalExpression "unifi-poller-unifi-default.password";
default = pkgs.writeText "unpoller-unifi-default.password" "unifi";
defaultText = literalExpression "unpoller-unifi-default.password";
description = lib.mdDoc ''
Path of a file containing the password for the unifi service user.
This file needs to be readable by the unifi-poller user.
@ -303,7 +307,7 @@ in {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${pkgs.unifi-poller}/bin/unifi-poller --config ${configFile}";
ExecStart = "${pkgs.unpoller}/bin/unpoller --config ${configFile}";
Restart = "always";
PrivateTmp = true;
ProtectHome = true;