1
0
Fork 0

mediaserver: Add mounts to systemd units

This commit is contained in:
Daniel Kempkens 2023-04-28 00:05:07 +02:00
parent 250bc99e3b
commit 4998a3c0d8
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
7 changed files with 117 additions and 64 deletions

View file

@ -35,9 +35,18 @@
};
};
systemd.services.podman-tubearchivist.serviceConfig = {
systemd.services.podman-tubearchivist =
let
mounts = [ "mnt-media-YTDL.mount" ];
in
{
requires = mounts;
after = lib.mkMerge mounts;
serviceConfig = {
TimeoutStopSec = lib.mkForce 30;
};
};
systemd.services.podman-archivist-redis.serviceConfig = {
TimeoutStopSec = lib.mkForce 30;

View file

@ -7,10 +7,15 @@ let
in
{
# The nix-provided options force a aria2-user to a certain degree
systemd.services.aria2 = {
systemd.services.aria2 =
let
mounts = [ "mnt-downloads.mount" ];
in
{
description = "aria2 Service";
requires = mounts;
bindsTo = [ "wg.service" ];
after = [ "wg.service" ];
after = [ "wg.service" ] ++ mounts;
wantedBy = [ "multi-user.target" ];
preStart = ''

View file

@ -8,6 +8,22 @@
openFirewall = false;
};
systemd.services.jellyfin =
let
mounts = [
"mnt-media-TV\\x20Shows.mount"
"mnt-media-Documentaries.mount"
"mnt-media-Anime.mount"
"mnt-media-Movies.mount"
"mnt-media-Deutsche\\x20Serien.mount"
"mnt-media-Deutsche\\x20Filme.mount"
];
in
{
requires = mounts;
after = lib.mkMerge mounts;
};
services.nginx.virtualHosts."jellyfin.internal.kempkens.network" = {
listen = [
{

View file

@ -8,9 +8,17 @@
openFirewall = false;
};
systemd.services.radarr = {
systemd.services.radarr =
let
mounts = [
"mnt-media-Movies.mount"
"mnt-downloads.mount"
];
in
{
requires = mounts;
bindsTo = [ "wg.service" ];
after = lib.mkForce [ "wg.service" ];
after = lib.mkForce ([ "wg.service" ] ++ mounts);
serviceConfig = {
NetworkNamespacePath = "/var/run/netns/wg";

View file

@ -2,10 +2,15 @@
{
# The nix-provided options force a sabnzbd-user to a certain degree
systemd.services.sabnzbd = {
systemd.services.sabnzbd =
let
mounts = [ "mnt-downloads.mount" ];
in
{
description = "sabnzbd server";
requires = mounts;
bindsTo = [ "wg.service" ];
after = [ "wg.service" ];
after = [ "wg.service" ] ++ mounts;
wantedBy = [ "multi-user.target" ];
serviceConfig = {

View file

@ -8,9 +8,19 @@
openFirewall = false;
};
systemd.services.sonarr = {
systemd.services.sonarr =
let
mounts = [
"mnt-media-TV\\x20Shows.mount"
"mnt-media-Documentaries.mount"
"mnt-media-Anime.mount"
"mnt-downloads.mount"
];
in
{
requires = mounts;
bindsTo = [ "wg.service" ];
after = lib.mkForce [ "wg.service" ];
after = lib.mkForce ([ "wg.service" ] ++ mounts);
serviceConfig = {
NetworkNamespacePath = "/var/run/netns/wg";