jellyfin: setup service
This commit is contained in:
parent
271fc656cc
commit
2b5ef6b145
4 changed files with 48 additions and 0 deletions
|
|
@ -5,7 +5,9 @@
|
|||
./bitwarden_rs.nix
|
||||
./borg-backup.nix
|
||||
./gitea.nix
|
||||
./jellyfin.nix
|
||||
./matrix.nix
|
||||
./media.nix
|
||||
./miniflux.nix
|
||||
./monitoring.nix
|
||||
./nginx.nix
|
||||
|
|
|
|||
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}/";
|
||||
};
|
||||
};
|
||||
}
|
||||
10
services/media.nix
Normal file
10
services/media.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
mediaServices = with config.my.services; [
|
||||
jellyfin
|
||||
];
|
||||
needed = builtins.any (service: service.enable) mediaServices;
|
||||
in
|
||||
{
|
||||
config.users.groups.media = lib.mkIf needed { };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue