Move non-upstreamed NixNG modules into this repo
This commit is contained in:
parent
4503a8f541
commit
3b0a54581d
10 changed files with 265 additions and 3 deletions
46
nixng-modules/jellyseerr.nix
Normal file
46
nixng-modules/jellyseerr.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.jellyseerr;
|
||||
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;
|
||||
};
|
||||
|
||||
configDir = lib.mkOption {
|
||||
description = ''
|
||||
The directory to save run-time configuration.
|
||||
'';
|
||||
type = lib.types.str;
|
||||
example = "/jellyseerr";
|
||||
default = "/var/lib/jellyseerr";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
init.services.jellyseerr = {
|
||||
enabled = true;
|
||||
script = lib.getExe cfg.package;
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = [cfg.package];
|
||||
variables = {
|
||||
PORT = builtins.toString cfg.port;
|
||||
CONFIG_DIRECTORY = cfg.configDir;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue