Skip to content

Commit

Permalink
nixos/whisparr: add settings option
Browse files Browse the repository at this point in the history
  • Loading branch information
Stunkymonkey committed Feb 21, 2025
1 parent 947c260 commit 385d0c7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nixos/modules/services/misc/whisparr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

let
cfg = config.services.whisparr;
servarr = import ./servarr/settings-options.nix { inherit lib pkgs; };
in
{
options = {
Expand All @@ -27,6 +28,8 @@ in
description = "Open ports in the firewall for the Whisparr web interface.";
};

settings = servarr.mkServarrSettingsOptions "whisparr" 6969;

user = lib.mkOption {
type = lib.types.str;
default = "whisparr";
Expand All @@ -48,6 +51,7 @@ in
description = "Whisparr";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment = servarr.mkServarrSettingsEnvVars "WHISPARR" cfg.settings;

serviceConfig = {
Type = "simple";
Expand All @@ -58,7 +62,9 @@ in
};
};

networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ 6969 ]; };
networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.settings.server.port ];
};

users.users = lib.mkIf (cfg.user == "whisparr") {
whisparr = {
Expand Down

0 comments on commit 385d0c7

Please sign in to comment.