Created
November 24, 2025 09:15
-
-
Save entropie/720b0e4fad1c690d88177d61eab6fb85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { config, pkgs, lib, flakeInputs, ... }: | |
| let | |
| jellyUID = 5000; | |
| jellyGID = 5000; | |
| mediaMountPoint = "/mnt/media"; | |
| remoteMediaPath = "nyx:/mnt/storage1/media"; | |
| jellyConfigPath = "/data/jellyfin/config"; | |
| jellyCachePath = "/data/jellyfin/cache"; | |
| in | |
| { | |
| users.users.jellyfin = { | |
| isSystemUser = true; | |
| description = "Jellyfin Service User"; | |
| home = "/var/lib/jellyfin"; | |
| createHome = true; | |
| group = "jellyfin"; | |
| uid = jellyUID; | |
| }; | |
| users.groups.jellyfin = { | |
| gid = jellyGID; | |
| }; | |
| environment.systemPackages = [ pkgs.sshfs ]; | |
| systemd.tmpfiles.rules = [ | |
| "d /data/jellyfin 0755 ${toString jellyUID} ${toString jellyGID} -" | |
| "d ${jellyConfigPath} 0755 ${toString jellyUID} ${toString jellyGID} -" | |
| "d ${jellyCachePath} 0755 ${toString jellyUID} ${toString jellyGID} -" | |
| ]; | |
| fileSystems.${mediaMountPoint} = { | |
| device = remoteMediaPath; | |
| fsType = "fuse.sshfs"; | |
| options = [ | |
| "IdentityFile=/root/.ssh/for_remote" | |
| "IdentitiesOnly=yes" | |
| "allow_other" | |
| "uid=${toString jellyUID}" | |
| "gid=${toString jellyGID}" | |
| "reconnect" | |
| "ServerAliveInterval=15" | |
| "ServerAliveCountMax=3" | |
| "StrictHostKeyChecking=no" | |
| "UserKnownHostsFile=/dev/null" | |
| "_netdev" | |
| ]; | |
| }; | |
| environment.etc."fuse.conf".text = '' | |
| user_allow_other | |
| ''; | |
| virtualisation.oci-containers.containers.jellyfin = { | |
| image = "linuxserver/jellyfin:latest"; | |
| autoStart = false; | |
| extraOptions = [ | |
| "--device=nvidia.com/gpu=all" | |
| "--runtime=nvidia" | |
| ]; | |
| ports = [ | |
| "8096:8096" | |
| "8920:8920" | |
| ]; | |
| volumes = [ | |
| "${jellyConfigPath}:/config" | |
| "${jellyCachePath}:/cache" | |
| "${mediaMountPoint}:/media" | |
| "/etc/nv_tegra_release:/etc/nv_tegra_release:ro" | |
| "/run/jtop.sock:/run/jtop.sock" | |
| ]; | |
| environment = { | |
| PUID = toString jellyUID; | |
| PGID = toString jellyGID; | |
| TZ = "Europe/Berlin"; | |
| JELLYFIN_PublishedServerUrl = "http://0.0.0.0:8096"; | |
| NVIDIA_VISIBLE_DEVICES = "all"; | |
| NVIDIA_DRIVER_CAPABILITIES = "compute,video,utility"; | |
| }; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment