Updated docs and removed some superflous statedirs from systemd-tmpfiles

This commit is contained in:
rasmus-kirk
2024-03-12 23:29:56 +01:00
parent 96fffa452d
commit 83e3246489
10 changed files with 152 additions and 62 deletions
+3 -1
View File
@@ -107,12 +107,13 @@ This example does the following:
enable = true; enable = true;
# These two values are also the default, but you can set them to whatever # These two values are also the default, but you can set them to whatever
# else you want # else you want
# WARNING: Do _not_ set them to `/home/user/whatever`, it will not work!
mediaDir = "/data/media"; mediaDir = "/data/media";
stateDir = "/data/media/.state/nixarr"; stateDir = "/data/media/.state/nixarr";
vpn = { vpn = {
enable = true; enable = true;
# IMPORTANT: This file must _not_ be in the config git directory # WARNING: This file must _not_ be in the config git directory
# You can usually get this wireguard file from your VPN provider # You can usually get this wireguard file from your VPN provider
wgConf = "/data/.secret/wg.conf"; wgConf = "/data/.secret/wg.conf";
}; };
@@ -136,6 +137,7 @@ This example does the following:
# It is possible for this module to run the *Arrs through a VPN, but it # It is possible for this module to run the *Arrs through a VPN, but it
# is generally not recommended, as it can cause rate-limiting issues. # is generally not recommended, as it can cause rate-limiting issues.
bazarr.enable = true;
sonarr.enable = true; sonarr.enable = true;
radarr.enable = true; radarr.enable = true;
prowlarr.enable = true; prowlarr.enable = true;
+13 -2
View File
@@ -18,8 +18,19 @@ in {
type = types.path; type = types.path;
default = "${nixarr.stateDir}/bazarr"; default = "${nixarr.stateDir}/bazarr";
defaultText = literalExpression ''"''${nixarr.stateDir}/bazarr"''; defaultText = literalExpression ''"''${nixarr.stateDir}/bazarr"'';
example = "/home/user/.local/share/nixarr/bazarr"; example = "/nixarr/.state/bazarr";
description = "The state directory for bazarr"; description = ''
The location of the state directory for the Bazarr service.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state/bazarr
```
Is not supported, because `/home/user` is owned by `user`.
'';
}; };
openFirewall = mkOption { openFirewall = mkOption {
+14 -7
View File
@@ -14,9 +14,20 @@ in with lib; {
stateDir = mkOption { stateDir = mkOption {
type = types.path; type = types.path;
default = "${nixarr.stateDir}/jellyfin"; default = "${nixarr.stateDir}/jellyfin";
defaultText = literalExpression ''!cfg.vpn.enable''; defaultText = literalExpression ''"''${nixarr.stateDir}/jellyfin"'';
example = "/home/user/.local/share/nixarr/jellyfin"; example = "/nixarr/.state/jellyfin";
description = "The state directory for Jellyfin."; description = ''
The location of the state directory for the Jellyfin service.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state/jellyfin
```
Is not supported, because `/home/user` is owned by `user`.
'';
}; };
openFirewall = mkOption { openFirewall = mkOption {
@@ -170,10 +181,6 @@ in with lib; {
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' 0700 streamer root - -" "d '${cfg.stateDir}' 0700 streamer root - -"
"d '${cfg.stateDir}/log' 0700 streamer root - -"
"d '${cfg.stateDir}/cache' 0700 streamer root - -"
"d '${cfg.stateDir}/data' 0700 streamer root - -"
"d '${cfg.stateDir}/config' 0700 streamer root - -"
]; ];
services.jellyfin = { services.jellyfin = {
+14 -7
View File
@@ -14,9 +14,20 @@ in {
stateDir = mkOption { stateDir = mkOption {
type = types.path; type = types.path;
default = "${nixarr.stateDir}/lidarr"; default = "${nixarr.stateDir}/lidarr";
defaultText = literalExpression ''!cfg.vpn.enable''; defaultText = literalExpression ''"''${nixarr.stateDir}/lidarr"'';
example = "/home/user/.local/share/nixarr/lidarr"; example = "/nixarr/.state/lidarr";
description = "The state directory for Lidarr"; description = ''
The location of the state directory for the Lidarr service.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state/lidarr
```
Is not supported, because `/home/user` is owned by `user`.
'';
}; };
openFirewall = mkOption { openFirewall = mkOption {
@@ -50,10 +61,6 @@ in {
} }
]; ];
systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' 0700 lidarr root - -"
];
services.lidarr = { services.lidarr = {
enable = cfg.enable; enable = cfg.enable;
user = "lidarr"; user = "lidarr";
+20 -2
View File
@@ -78,18 +78,36 @@ in {
mediaDir = mkOption { mediaDir = mkOption {
type = types.path; type = types.path;
default = "/data/media"; default = "/data/media";
example = "/home/user/nixarr"; example = "/nixarr";
description = '' description = ''
The location of the media directory for the services. The location of the media directory for the services.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
mediaDir = /home/user/nixarr
```
Is not supported, because `/home/user` is owned by `user`.
''; '';
}; };
stateDir = mkOption { stateDir = mkOption {
type = types.path; type = types.path;
default = "/data/.state/nixarr"; default = "/data/.state/nixarr";
example = "/home/user/.local/share/nixarr"; example = "/nixarr/.state";
description = '' description = ''
The location of the state directory for the services. The location of the state directory for the services.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state
```
Is not supported, because `/home/user` is owned by `user`.
''; '';
}; };
+14 -7
View File
@@ -19,9 +19,20 @@ in {
stateDir = mkOption { stateDir = mkOption {
type = types.path; type = types.path;
default = "${nixarr.stateDir}/prowlarr"; default = "${nixarr.stateDir}/prowlarr";
defaultText = literalExpression ''!cfg.vpn.enable''; defaultText = literalExpression ''"''${nixarr.stateDir}/prowlarr"'';
example = "/home/user/.local/share/nixarr/prowlarr"; example = "/nixarr/.state/prowlarr";
description = "The state directory for Prowlarr."; description = ''
The location of the state directory for the Prowlarr service.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state/prowlarr
```
Is not supported, because `/home/user` is owned by `user`.
'';
}; };
openFirewall = mkOption { openFirewall = mkOption {
@@ -55,10 +66,6 @@ in {
} }
]; ];
systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' 0700 prowlarr root - -"
];
util-nixarr.services.prowlarr = { util-nixarr.services.prowlarr = {
enable = true; enable = true;
openFirewall = cfg.openFirewall; openFirewall = cfg.openFirewall;
+14 -7
View File
@@ -15,9 +15,20 @@ in {
stateDir = mkOption { stateDir = mkOption {
type = types.path; type = types.path;
default = "${nixarr.stateDir}/radarr"; default = "${nixarr.stateDir}/radarr";
defaultText = literalExpression ''!cfg.vpn.enable''; defaultText = literalExpression ''"''${nixarr.stateDir}/radarr"'';
example = "/home/user/.local/share/nixarr/radarr"; example = "/nixarr/.state/radarr";
description = "The state directory for radarr."; description = ''
The location of the state directory for the Radarr service.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state/radarr
```
Is not supported, because `/home/user` is owned by `user`.
'';
}; };
openFirewall = mkOption { openFirewall = mkOption {
@@ -51,10 +62,6 @@ in {
} }
]; ];
systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' 0700 radarr root - -"
];
services.radarr = { services.radarr = {
enable = cfg.enable; enable = cfg.enable;
user = "radarr"; user = "radarr";
+14 -7
View File
@@ -13,9 +13,20 @@ in {
stateDir = mkOption { stateDir = mkOption {
type = types.path; type = types.path;
default = "${nixarr.stateDir}/readarr"; default = "${nixarr.stateDir}/readarr";
defaultText = literalExpression ''!cfg.vpn.enable''; defaultText = literalExpression ''"''${nixarr.stateDir}/readarr"'';
example = "/home/user/.local/share/nixarr/readarr"; example = "/nixarr/.state/readarr";
description = "The state directory for Readarr"; description = ''
The location of the state directory for the Readarr service.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state/readarr
```
Is not supported, because `/home/user` is owned by `user`.
'';
}; };
openFirewall = mkOption { openFirewall = mkOption {
@@ -49,10 +60,6 @@ in {
} }
]; ];
systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' 0700 readarr root - -"
];
services.readarr = { services.readarr = {
enable = cfg.enable; enable = cfg.enable;
user = "readarr"; user = "readarr";
+14 -7
View File
@@ -19,9 +19,20 @@ in {
stateDir = mkOption { stateDir = mkOption {
type = types.path; type = types.path;
default = "${nixarr.stateDir}/sonarr"; default = "${nixarr.stateDir}/sonarr";
defaultText = literalExpression ''!cfg.vpn.enable''; defaultText = literalExpression ''"''${nixarr.stateDir}/sonarr"'';
example = "/home/user/.local/share/nixarr/sonarr"; example = "/nixarr/.state/sonarr";
description = "The state directory for Sonarr."; description = ''
The location of the state directory for the Sonarr service.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state/sonarr
```
Is not supported, because `/home/user` is owned by `user`.
'';
}; };
openFirewall = mkOption { openFirewall = mkOption {
@@ -55,10 +66,6 @@ in {
} }
]; ];
systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' 0700 sonarr root - -"
];
services.sonarr = { services.sonarr = {
enable = cfg.enable; enable = cfg.enable;
user = "sonarr"; user = "sonarr";
+24 -7
View File
@@ -67,10 +67,19 @@ in {
stateDir = mkOption { stateDir = mkOption {
type = types.path; type = types.path;
default = "${nixarr.stateDir}/transmission"; default = "${nixarr.stateDir}/transmission";
defaultText = literalExpression ''!cfg.vpn.enable''; defaultText = literalExpression ''"''${nixarr.stateDir}/transmission"'';
example = "/home/user/.local/share/nixarr/transmission"; example = "/nixarr/.state/transmission";
description = '' description = ''
The state directory for Transmission. The location of the state directory for the Transmission service.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state/transmission
```
Is not supported, because `/home/user` is owned by `user`.
''; '';
}; };
@@ -127,9 +136,18 @@ in {
type = types.path; type = types.path;
default = "${nixarr.stateDir}/cross-seed"; default = "${nixarr.stateDir}/cross-seed";
defaultText = literalExpression ''"''${nixarr.stateDir}/cross-seed"''; defaultText = literalExpression ''"''${nixarr.stateDir}/cross-seed"'';
example = "/home/user/.local/share/nixarr/cross-seed"; example = "/nixarr/.state/cross-seed";
description = '' description = ''
The state directory for Transmission. The location of the state directory for the cross-seed service.
**Warning:** Setting this to any path, where the subpath is not
owned by root, will fail! For example:
```nix
stateDir = /home/user/nixarr/.state/cross-seed
```
Is not supported, because `/home/user` is owned by `user`.
''; '';
}; };
@@ -235,8 +253,7 @@ in {
"d '${cfg.stateDir}' 0750 torrenter torrenter - -" "d '${cfg.stateDir}' 0750 torrenter torrenter - -"
# This is fixes a bug in nixpks (https://github.com/NixOS/nixpkgs/issues/291883) # This is fixes a bug in nixpks (https://github.com/NixOS/nixpkgs/issues/291883)
"d '${cfg.stateDir}/.config/transmission-daemon' 0750 torrenter torrenter - -" "d '${cfg.stateDir}/.config/transmission-daemon' 0750 torrenter torrenter - -"
] ++ optional cfg-cross-seed.enable ];
"d '${cfg-cross-seed.stateDir}' 0700 cross-seed root - -";
util-nixarr.services.cross-seed = mkIf cfg-cross-seed.enable { util-nixarr.services.cross-seed = mkIf cfg-cross-seed.enable {
enable = true; enable = true;