jellyfin: setup service
This commit is contained in:
parent
271fc656cc
commit
2b5ef6b145
4 changed files with 48 additions and 0 deletions
32
services/jellyfin.nix
Normal file
32
services/jellyfin.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.my.services.jellyfin;
|
||||
my = config.my;
|
||||
|
||||
domain = config.networking.domain;
|
||||
|
||||
# hardcoded in NixOS module :(
|
||||
jellyfinPort = 8096;
|
||||
in {
|
||||
options.my.services.jellyfin = {
|
||||
enable = mkEnableOption "Jellyfin";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.jellyfin = {
|
||||
enable = true;
|
||||
group = "media";
|
||||
};
|
||||
|
||||
# Proxy to Jellyfin
|
||||
services.nginx.virtualHosts."jellyfin.${domain}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
|
||||
locations."/".proxyPass = "http://localhost:${toString jellyfinPort}/";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue