fix: API wasn't wanted by anyone

This commit is contained in:
Inex Code 2024-12-07 20:18:23 +03:00
parent 90effd391a
commit 1613dbfec2
No known key found for this signature in database

View file

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