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 pkgs.gitMinimal
config.nix.package.out config.nix.package.out
pkgs.restic pkgs.restic
pkgs.rclone
pkgs.mkpasswd pkgs.mkpasswd
pkgs.util-linux pkgs.util-linux
pkgs.e2fsprogs pkgs.e2fsprogs
@ -48,11 +49,13 @@ in
]; ];
after = [ "network-online.target" ]; after = [ "network-online.target" ];
wants = [ "network-online.target" ]; wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
User = "root"; User = "root";
ExecStart = "${selfprivacy-graphql-api}/bin/app.py"; ExecStart = "${selfprivacy-graphql-api}/bin/app.py";
Restart = "always"; Restart = "always";
RestartSec = "5"; RestartSec = "5";
Slice = "selfprivacy_api.slice";
}; };
}; };
systemd.services.selfprivacy-api-worker = { systemd.services.selfprivacy-api-worker = {
@ -73,6 +76,7 @@ in
pkgs.gitMinimal pkgs.gitMinimal
config.nix.package.out config.nix.package.out
pkgs.restic pkgs.restic
pkgs.rclone
pkgs.mkpasswd pkgs.mkpasswd
pkgs.util-linux pkgs.util-linux
pkgs.e2fsprogs pkgs.e2fsprogs
@ -80,13 +84,19 @@ in
]; ];
after = [ "network-online.target" ]; after = [ "network-online.target" ];
wants = [ "network-online.target" ]; wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
User = "root"; User = "root";
ExecStart = "${pkgs.python312Packages.huey}/bin/huey_consumer.py selfprivacy_api.task_registry.huey"; ExecStart = "${pkgs.python312Packages.huey}/bin/huey_consumer.py selfprivacy_api.task_registry.huey";
Restart = "always"; Restart = "always";
RestartSec = "5"; 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 # One shot systemd service to rebuild NixOS using nixos-rebuild
systemd.services.sp-nixos-rebuild = { systemd.services.sp-nixos-rebuild = {
description = "nixos-rebuild switch"; description = "nixos-rebuild switch";