jellyfin container
This commit is contained in:
parent
f254c80baa
commit
6d24800e96
2 changed files with 97 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ in {
|
|||
./nginx.nix
|
||||
./forgejo.nix
|
||||
./vaultwarden.nix
|
||||
./jellyfin.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
|
|
|
|||
96
modules/containers/jellyfin.nix
Normal file
96
modules/containers/jellyfin.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue