Skip to content

Commit

Permalink
Changed firewall settings
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-kirk committed Mar 12, 2024
1 parent 39f6357 commit 55f11fd
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 2 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 ''"''${nixarr.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
9 changes: 9 additions & 0 deletions nixarr/jellyfin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ in with lib; {
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
9 changes: 9 additions & 0 deletions nixarr/lidarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ in {
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
9 changes: 9 additions & 0 deletions nixarr/prowlarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ in {
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
9 changes: 9 additions & 0 deletions nixarr/radarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ in {
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
9 changes: 9 additions & 0 deletions nixarr/readarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ in {
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
9 changes: 9 additions & 0 deletions nixarr/sonarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ in {
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
12 changes: 10 additions & 2 deletions nixarr/transmission/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ in {
'';
};

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 55f11fd

Please sign in to comment.