From 1613dbfec26e970fc3e265ea96b30756e6b1a5c3 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sat, 7 Dec 2024 20:18:23 +0300 Subject: [PATCH] fix: API wasn't wanted by anyone --- nixos/module.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/module.nix b/nixos/module.nix index 2397a0a..6199597 100644 --- a/nixos/module.nix +++ b/nixos/module.nix @@ -41,6 +41,7 @@ in pkgs.gitMinimal config.nix.package.out pkgs.restic + pkgs.rclone pkgs.mkpasswd pkgs.util-linux pkgs.e2fsprogs @@ -48,11 +49,13 @@ in ]; after = [ "network-online.target" ]; wants = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; serviceConfig = { User = "root"; ExecStart = "${selfprivacy-graphql-api}/bin/app.py"; Restart = "always"; RestartSec = "5"; + Slice = "selfprivacy_api.slice"; }; }; systemd.services.selfprivacy-api-worker = { @@ -73,6 +76,7 @@ in pkgs.gitMinimal config.nix.package.out pkgs.restic + pkgs.rclone pkgs.mkpasswd pkgs.util-linux pkgs.e2fsprogs @@ -80,13 +84,19 @@ in ]; after = [ "network-online.target" ]; wants = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; serviceConfig = { User = "root"; 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" = { + 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";