Skip to content

Commit

Permalink
Add option for port
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzapim committed Dec 16, 2024
1 parent d3ac1a0 commit 0c0c458
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
6 changes: 5 additions & 1 deletion examples/jellyseerr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ nglib.makeSystem {
{
dinit.enable = true;
init.services.jellyseerr.shutdownOnExit = true;
services.jellyseerr.enable = true;

services.jellyseerr = {
enable = true;
port = 8080;
};
};
}
20 changes: 14 additions & 6 deletions modules/services/jellyseerr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,27 @@ in
options.services.jellyseerr = {
enable = lib.mkEnableOption "jellyseerr";
package = lib.mkPackageOption pkgs "jellyseerr" { };

port = lib.mkOption {
description = ''
The port Jellyseerr should listen on.
'';
type = lib.types.port;
example = 8080;
default = 5055;
};
};

config = lib.mkIf cfg.enable {
init.services.jellyseerr = {
enabled = true;
workingDirectory = "${cfg.package}/libexec/jellyseerr/deps/jellyseerr";

# TODO: simplify?
script = pkgs.writeShellScript "jellyseerr-run.sh" ''
${lib.getExe cfg.package}
'';
script = lib.getExe cfg.package;
};

environment.systemPackages = [ cfg.package ];
environment = {
systemPackages = [ cfg.package ];
variables.PORT = builtins.toString cfg.port;
};
};
}

0 comments on commit 0c0c458

Please sign in to comment.