jellyfin container

This commit is contained in:
KoenDR06 2026-02-19 00:58:56 +01:00
parent f254c80baa
commit 6d24800e96
2 changed files with 97 additions and 0 deletions

View file

@ -10,6 +10,7 @@ in {
./nginx.nix ./nginx.nix
./forgejo.nix ./forgejo.nix
./vaultwarden.nix ./vaultwarden.nix
./jellyfin.nix
]; ];
options = { options = {

View file

@ -0,0 +1,96 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: let
inherit (lib) types mkOption mkEnableOption mkIf;
cfg = config.horseman.containers.jellyfin;
username = config.horseman.username;
# BACKUP_DIR = config.horseman.containers.backupDir;
DATA_DIR = "/home/${username}/backups/volumes/jellyfin";
in {
options = {
horseman.containers.jellyfin = {
enable = mkEnableOption "Watch content from 'the high seas'";
port = mkOption {
default = 8096;
type = types.int;
};
url = mkOption {
default = "https://watch.koendev.nl";
type = types.str;
};
};
};
config = mkIf cfg.enable {
systemd.timers."backup-jellyfin" = {
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
# environment.systemPackages = [pkgs.gnutar];
# systemd.services."backup-jellyfin" = {
# script = ''
# cd ${BACKUP_DIR}
# ${pkgs.gnutar}/bin/tar -cf jellyfin-$(date +'%Y-%m-%d').tar ${DATA_DIR}
# '';
# serviceConfig = {
# User = "root";
# };
# };
containers.jellyfin = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.5";
localAddress = "192.168.100.105";
bindMounts = {
"/var/lib/media" = {
hostPath = DATA_DIR;
isReadOnly = false;
};
};
config = {
config,
pkgs,
...
}: {
environment.systemPackages = with pkgs; [
jellyfin
jellyfin-ffmpeg
jellyfin-web
];
services.jellyfin = {
enable = true;
};
services.prowlarr = {
enable = true;
openFirewall = true;
};
networking = {
firewall = {
enable = true;
allowedTCPPorts = [cfg.port];
};
useHostResolvConf = lib.mkForce false;
};
system.stateVersion = "23.11";
};
};
};
}