enum instead of str for checker types, use "lego-monitoring" instead of "service" bin name

This commit is contained in:
Alex Tau 2025-04-30 17:24:52 +03:00
parent ffdd0429b3
commit 19ee6f487b
3 changed files with 7 additions and 4 deletions

View file

@ -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";
};
};

View file

@ -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" ];
};
};

View file

@ -10,7 +10,7 @@ dependencies = [
]
[project.scripts]
service = "lego_monitoring:main"
lego-monitoring = "lego_monitoring:main"
[build-system]
requires = ["hatchling"]