summary refs log tree commit diff
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2022-11-24 15:30:14 +0000
committerLuke Granger-Brown <git@lukegb.com>2022-12-03 20:12:54 +0000
commitffcd97b521a413eb53b532952be847406a9495ed (patch)
tree21b10d54c348f7e353c599f7f0ffe77a2a31406a
parent40ddf3e2c6c18122ba4d783252870adb7c5dff92 (diff)
downloadnixpkgs-ffcd97b521a413eb53b532952be847406a9495ed.tar
nixpkgs-ffcd97b521a413eb53b532952be847406a9495ed.tar.gz
nixpkgs-ffcd97b521a413eb53b532952be847406a9495ed.tar.bz2
nixpkgs-ffcd97b521a413eb53b532952be847406a9495ed.tar.lz
nixpkgs-ffcd97b521a413eb53b532952be847406a9495ed.tar.xz
nixpkgs-ffcd97b521a413eb53b532952be847406a9495ed.tar.zst
nixpkgs-ffcd97b521a413eb53b532952be847406a9495ed.zip
nixos/unifi-poller: rename to unpoller.
-rw-r--r--nixos/modules/module-list.nix2
-rw-r--r--nixos/modules/services/monitoring/unpoller.nix (renamed from nixos/modules/services/monitoring/unifi-poller.nix)26
2 files changed, 16 insertions, 12 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 59d6cf165f1..3d6f1e84ece 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -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
diff --git a/nixos/modules/services/monitoring/unifi-poller.nix b/nixos/modules/services/monitoring/unpoller.nix
index b30e28a3ecc..f0ced5513d6 100644
--- a/nixos/modules/services/monitoring/unifi-poller.nix
+++ b/nixos/modules/services/monitoring/unpoller.nix
@@ -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;