Add systemd slices to all SP modules

This commit is contained in:
Inex Code 2024-07-27 02:52:21 +03:00
parent d7f283468a
commit 80dfbf3d5c
9 changed files with 86 additions and 9 deletions

View file

@ -116,5 +116,12 @@ in
# NixOS upstream bug? Otherwise, backup-vaultwarden cannot find sqlite DB.
systemd.services.backup-vaultwarden.unitConfig.ConditionPathExists =
"/var/lib/bitwarden_rs/db.sqlite3";
systemd = {
services.vaultwarden.serviceConfig.Slice = "bitwarden.slice";
slices.bitwarden = {
description = "Bitwarden service slice";
};
};
};
}

View file

@ -146,14 +146,17 @@ in
};
};
};
systemd.services.forgejo = {
unitConfig.RequiresMountsFor = lib.mkIf sp.useBinds "/volumes/${cfg.location}/gitea";
serviceConfig = {
Slice = "gitea.slice";
systemd = {
services.forgejo = {
unitConfig.RequiresMountsFor = lib.mkIf sp.useBinds "/volumes/${cfg.location}/gitea";
serviceConfig = {
Slice = "gitea.slice";
};
};
slices.gitea = {
description = "Forgejo service slice";
};
};
systemd.slices.gitea = {
description = "Forgejo service slice";
};
};
}

View file

@ -40,5 +40,15 @@ in
useACMEHost = domain;
enableACME = false;
};
systemd = {
services = {
jicofo.serviceConfig.Slice = "jitsi-meet.slice";
jitsi-videobridge2.serviceConfig.Slice = "jitsi-meet.slice";
prosody.serviceConfig.Slice = "jitsi-meet.slice";
};
slices.jitsi-meet = {
description = "Jitsi Meet service slice";
};
};
};
}

View file

@ -1,6 +1,8 @@
{config, lib, ...}: let
{ config, lib, ... }:
let
cfg = config.selfprivacy.modules.monitoring;
in {
in
{
options.selfprivacy.modules.monitoring = {
enable = lib.mkOption {
default = false;
@ -54,5 +56,15 @@ in {
}
];
};
systemd = {
services = {
prometheus.serviceConfig.Slice = "monitoring.slice";
prometheus-node-exporter.serviceConfig.Slice = "monitoring.slice";
cadvisor.serviceConfig.Slice = "monitoring.slice";
};
slices.monitoring = {
description = "Monitoring service slice";
};
};
};
}

View file

@ -83,5 +83,13 @@
useACMEHost = sp.domain;
forceSSL = true;
};
systemd = {
services = {
phpfpm-nextcloud.serviceConfig.Slice = "nextcloud.slice";
};
slices.nextcloud = {
description = "Nextcloud service slice";
};
};
};
}

View file

@ -76,5 +76,13 @@ in
'';
};
systemd.services.ocserv.unitConfig.ConditionPathExists = [ cert key ];
systemd = {
services = {
ocserv.serviceConfig.Slice = "ocserv.slice";
};
slices.ocserv = {
description = "ocserv service slice";
};
};
};
}

View file

@ -126,5 +126,13 @@ in
};
};
};
systemd = {
services = {
pleroma.serviceConfig.Slice = "pleroma.slice";
};
slices.pleroma = {
description = "Pleroma service slice";
};
};
};
}

View file

@ -35,5 +35,13 @@ in
useACMEHost = domain;
enableACME = false;
};
systemd = {
services = {
phpfpm-roundcube.serviceConfig.Slice = "roundcube.slice";
};
slices.roundcube = {
description = "Roundcube service slice";
};
};
};
}

View file

@ -89,4 +89,17 @@ lib.mkIf sp.modules.simple-nixos-mailserver.enable
virusScanning = false;
};
systemd = {
services = {
dovecot2.serviceConfig.Slice = "simple-nixos-mailserver.slice";
postfix.serviceConfig.Slice = "simple-nixos-mailserver.slice";
rspamd.serviceConfig.Slice = "simple-nixos-mailserver.slice";
redis-rspamd.serviceConfig.Slice = "simple-nixos-mailserver.slice";
opendkim.serviceConfig.Slice = "simple-nixos-mailserver.slice";
};
slices.simple-nixos-mailserver = {
description = "Simple NixOS Mailserver service slice";
};
};
}