Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-kirk committed Mar 12, 2024
2 parents 8fbc7ca + 55f11fd commit 91b5a9f
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 9 deletions.
9 changes: 9 additions & 0 deletions nixarr/bazarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ in {
description = "The state directory for bazarr";
};

openFirewall = mkOption {
type = types.bool;
defaultText = literalExpression ''!cfg.vpn.enable'';
default = !cfg.vpn.enable;
example = true;
description = "Open firewall for Bazarr";
};

vpn.enable = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -49,6 +57,7 @@ in {
enable = cfg.enable;
user = "bazarr";
group = "media";
openFirewall = cfg.openFirewall;
dataDir = cfg.stateDir;
};

Expand Down
11 changes: 10 additions & 1 deletion nixarr/jellyfin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ in with lib; {
stateDir = mkOption {
type = types.path;
default = "${nixarr.stateDir}/jellyfin";
defaultText = literalExpression ''"''${nixarr.stateDir}/jellyfin"'';
defaultText = literalExpression ''!cfg.vpn.enable'';
example = "/home/user/.local/share/nixarr/jellyfin";
description = "The state directory for Jellyfin.";
};

openFirewall = mkOption {
type = types.bool;
defaultText = literalExpression ''"''${nixarr.vpn.enable}"'';
default = !cfg.vpn.enable;
example = true;
description = "Open firewall for Jellyfin";
};

vpn.enable = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -168,6 +176,7 @@ in with lib; {
enable = cfg.enable;
user = "streamer";
group = "streamer";
openFirewall = cfg.openFirewall;
logDir = "${cfg.stateDir}/log";
cacheDir = "${cfg.stateDir}/cache";
dataDir = "${cfg.stateDir}/data";
Expand Down
11 changes: 10 additions & 1 deletion nixarr/lidarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ in {
stateDir = mkOption {
type = types.path;
default = "${nixarr.stateDir}/lidarr";
defaultText = literalExpression ''"''${nixarr.stateDir}/lidarr"'';
defaultText = literalExpression ''!cfg.vpn.enable'';
example = "/home/user/.local/share/nixarr/lidarr";
description = "The state directory for Lidarr";
};

openFirewall = mkOption {
type = types.bool;
defaultText = literalExpression ''"''${nixarr.vpn.enable}"'';
default = !cfg.vpn.enable;
example = true;
description = "Open firewall for Lidarr";
};

vpn.enable = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -50,6 +58,7 @@ in {
enable = cfg.enable;
user = "lidarr";
group = "media";
openFirewall = cfg.openFirewall;
dataDir = cfg.stateDir;
};

Expand Down
11 changes: 10 additions & 1 deletion nixarr/prowlarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ in {
stateDir = mkOption {
type = types.path;
default = "${nixarr.stateDir}/prowlarr";
defaultText = literalExpression ''"''${nixarr.stateDir}/prowlarr"'';
defaultText = literalExpression ''!cfg.vpn.enable'';
example = "/home/user/.local/share/nixarr/prowlarr";
description = "The state directory for Prowlarr.";
};

openFirewall = mkOption {
type = types.bool;
defaultText = literalExpression ''"''${nixarr.vpn.enable}"'';
default = !cfg.vpn.enable;
example = true;
description = "Open firewall for Prowlarr";
};

vpn.enable = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -53,6 +61,7 @@ in {

util-nixarr.services.prowlarr = {
enable = true;
openFirewall = cfg.openFirewall;
dataDir = cfg.stateDir;
};

Expand Down
11 changes: 10 additions & 1 deletion nixarr/radarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@ in {
stateDir = mkOption {
type = types.path;
default = "${nixarr.stateDir}/radarr";
defaultText = literalExpression ''"''${nixarr.stateDir}/radarr"'';
defaultText = literalExpression ''!cfg.vpn.enable'';
example = "/home/user/.local/share/nixarr/radarr";
description = "The state directory for radarr.";
};

openFirewall = mkOption {
type = types.bool;
defaultText = literalExpression ''"''${nixarr.vpn.enable}"'';
default = !cfg.vpn.enable;
example = true;
description = "Open firewall for Radarr";
};

vpn.enable = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -51,6 +59,7 @@ in {
enable = cfg.enable;
user = "radarr";
group = "media";
openFirewall = cfg.openFirewall;
dataDir = cfg.stateDir;
};

Expand Down
11 changes: 10 additions & 1 deletion nixarr/readarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ in {
stateDir = mkOption {
type = types.path;
default = "${nixarr.stateDir}/readarr";
defaultText = literalExpression ''"''${nixarr.stateDir}/readarr"'';
defaultText = literalExpression ''!cfg.vpn.enable'';
example = "/home/user/.local/share/nixarr/readarr";
description = "The state directory for Readarr";
};

openFirewall = mkOption {
type = types.bool;
defaultText = literalExpression ''"''${nixarr.vpn.enable}"'';
default = !cfg.vpn.enable;
example = true;
description = "Open firewall for Readarr";
};

vpn.enable = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -49,6 +57,7 @@ in {
enable = cfg.enable;
user = "readarr";
group = "media";
openFirewall = cfg.openFirewall;
dataDir = cfg.stateDir;
};

Expand Down
11 changes: 10 additions & 1 deletion nixarr/sonarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ in {
stateDir = mkOption {
type = types.path;
default = "${nixarr.stateDir}/sonarr";
defaultText = literalExpression ''"''${nixarr.stateDir}/sonarr"'';
defaultText = literalExpression ''!cfg.vpn.enable'';
example = "/home/user/.local/share/nixarr/sonarr";
description = "The state directory for Sonarr.";
};

openFirewall = mkOption {
type = types.bool;
defaultText = literalExpression ''"''${nixarr.vpn.enable}"'';
default = !cfg.vpn.enable;
example = true;
description = "Open firewall for Sonarr";
};

vpn.enable = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -55,6 +63,7 @@ in {
enable = cfg.enable;
user = "sonarr";
group = "media";
openFirewall = cfg.openFirewall;
dataDir = cfg.stateDir;
};

Expand Down
14 changes: 11 additions & 3 deletions nixarr/transmission/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,21 @@ in {
stateDir = mkOption {
type = types.path;
default = "${nixarr.stateDir}/transmission";
defaultText = literalExpression ''"''${nixarr.stateDir}/transmission"'';
defaultText = literalExpression ''!cfg.vpn.enable'';
example = "/home/user/.local/share/nixarr/transmission";
description = ''
The state directory for Transmission.
'';
};

openFirewall = mkOption {
type = types.bool;
defaultText = literalExpression ''"''${nixarr.vpn.enable}"'';
default = !cfg.vpn.enable;
example = true;
description = "Open firewall for `peer-port` and `rpc-port`.";
};

vpn.enable = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -270,8 +278,8 @@ in {
then pkgs.flood-for-transmission
else null;
package = pkgs.transmission_4;
openRPCPort = false;
openPeerPorts = !cfg.vpn.enable;
openRPCPort = cfg.openFirewall;
openPeerPorts = cfg.openFirewall;
settings =
{
download-dir = downloadDir;
Expand Down

0 comments on commit 91b5a9f

Please sign in to comment.