diff --git a/nixos/module.nix b/nixos/module.nix index 557f703..31a5678 100644 --- a/nixos/module.nix +++ b/nixos/module.nix @@ -54,6 +54,7 @@ in ExecStart = "${selfprivacy-graphql-api}/bin/app.py"; Restart = "always"; RestartSec = "5"; + Slice = "selfprivacy_api.slice"; }; }; systemd.services.selfprivacy-api-worker = { @@ -87,8 +88,13 @@ in ExecStart = "${pkgs.python312Packages.huey}/bin/huey_consumer.py selfprivacy_api.task_registry.huey"; Restart = "always"; RestartSec = "5"; + Slice = "selfprivacy_api.slice"; }; }; + systemd.slices."selfprivacy_api.slice" = { + name = "selfprivacy_api.slice"; + description = "Slice for SelfPrivacy API services"; + }; # One shot systemd service to rebuild NixOS using nixos-rebuild systemd.services.sp-nixos-rebuild = { description = "nixos-rebuild switch"; diff --git a/selfprivacy_api/services/__init__.py b/selfprivacy_api/services/__init__.py index 755e389..4625ee0 100644 --- a/selfprivacy_api/services/__init__.py +++ b/selfprivacy_api/services/__init__.py @@ -88,7 +88,7 @@ class ServiceManager(Service): @staticmethod def get_id() -> str: """Return service id.""" - return "api" + return "selfprivacy-api" @staticmethod def get_display_name() -> str: @@ -98,7 +98,7 @@ class ServiceManager(Service): @staticmethod def get_description() -> str: """Return service description.""" - return "A proto-service for API itself. Currently manages backups of settings." + return "Enables communication between the SelfPrivacy app and the server." @staticmethod def get_svg_icon() -> str: @@ -135,7 +135,7 @@ class ServiceManager(Service): @staticmethod def get_backup_description() -> str: - return "How did we get here?" + return "General server settings." @classmethod def get_status(cls) -> ServiceStatus: