From 19ee6f487b0a2f13072ea5450a51fc8c698d51ac Mon Sep 17 00:00:00 2001 From: Alex Tau Date: Wed, 30 Apr 2025 17:24:52 +0300 Subject: [PATCH] enum instead of str for checker types, use "lego-monitoring" instead of "service" bin name --- flake.nix | 2 +- modules/default.nix | 7 +++++-- pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 1d8e21e..a445160 100644 --- a/flake.nix +++ b/flake.nix @@ -100,7 +100,7 @@ apps.x86_64-linux = { default = { type = "app"; - program = "${self.packages.x86_64-linux.default}/bin/service"; + program = "${self.packages.x86_64-linux.default}/bin/lego-monitoring"; }; }; diff --git a/modules/default.nix b/modules/default.nix index 8808560..516c50c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -12,7 +12,10 @@ package: enable = lib.mkEnableOption "lego-monitoring service."; enabledCheckerSets = lib.mkOption { - type = lib.types.listOf lib.types.str; + type = lib.types.listOf (lib.types.enum [ + "start" + "stop" + ]); default = [ ]; description = "List of enabled checker sets. Each checker set is a module which checks something and generates alerts based on check results."; }; @@ -43,7 +46,7 @@ package: systemd.services.lego-monitoring = { name = "lego-monitoring.service"; description = "Lego-monitoring service"; - script = "${package}/bin/service -c ${serviceConfigFile}"; + script = "${package}/bin/lego-monitoring -c ${serviceConfigFile}"; wantedBy = [ "multi-user.target" ]; }; }; diff --git a/pyproject.toml b/pyproject.toml index 11bdaf3..5ed90ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ dependencies = [ ] [project.scripts] -service = "lego_monitoring:main" +lego-monitoring = "lego_monitoring:main" [build-system] requires = ["hatchling"]