diff --git a/hosts/glyph/hardware.nix b/hosts/glyph/hardware.nix index 904887b2..dc7ce697 100644 --- a/hosts/glyph/hardware.nix +++ b/hosts/glyph/hardware.nix @@ -40,4 +40,13 @@ boot.binfmt.emulatedSystems = ["aarch64-linux"]; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver + intel-compute-runtime + vpl-gpu-rt + ]; + }; } diff --git a/hosts/glyph/services/default.nix b/hosts/glyph/services/default.nix index 9e65e505..931b3e86 100644 --- a/hosts/glyph/services/default.nix +++ b/hosts/glyph/services/default.nix @@ -7,6 +7,7 @@ ./avahi.nix ./dns.nix ./filebrowser.nix + ./jellyfin.nix ./nfs.nix ./prometheus.nix ./samba.nix @@ -17,10 +18,6 @@ services.cockpit.enable = true; services.openssh.enable = true; - services.plex = { - enable = true; - openFirewall = true; - }; services.roon-server = { enable = true; openFirewall = true; diff --git a/hosts/glyph/services/jellyfin.nix b/hosts/glyph/services/jellyfin.nix new file mode 100644 index 00000000..411fcceb --- /dev/null +++ b/hosts/glyph/services/jellyfin.nix @@ -0,0 +1,42 @@ +{ + config, + pkgs, + lib, + ... +}: { + services.jellyfin = { + enable = true; + group = "media"; + openFirewall = true; + hardwareAcceleration = { + enable = true; + type = "qsv"; + device = "/dev/dri/renderD128"; + }; + transcoding = { + enableHardwareEncoding = true; + enableIntelLowPowerEncoding = true; + hardwareDecodingCodecs = { + h264 = true; + hevc = true; + vp9 = true; + av1 = true; + mpeg2 = true; + vc1 = true; + }; + hardwareEncodingCodecs = { + hevc = true; + av1 = false; # Intel Arc only + }; + }; + }; + + users.users.${config.services.jellyfin.user}.extraGroups = [ + "video" + "render" + ]; + + services.meilisearch = { + enable = true; + }; +} diff --git a/hosts/glyph/services/samba.nix b/hosts/glyph/services/samba.nix index 85637fb5..7ff474bf 100644 --- a/hosts/glyph/services/samba.nix +++ b/hosts/glyph/services/samba.nix @@ -21,7 +21,7 @@ shares = { Archive = mkShare "/mnt/archive" "mu" "users"; Backup = mkShare "/mnt/backup" "mu" "users" // {"fruit:time machine" = "yes";}; - Media = mkShare "/mnt/media" config.services.plex.user config.services.plex.group; + Media = mkShare "/mnt/media" config.services.jellyfin.user config.services.jellyfin.group; Torrents = mkShare "/mnt/torrents" config.services.transmission.user config.services.transmission.group; Unsorted = mkShare "/mnt/unsorted" "mu" "users"; }; @@ -58,13 +58,13 @@ Type = "oneshot"; ExecStart = let defaultUsrGrp = "mu:users"; - plexUsrGrp = with config.services.plex; "${user}:${group}"; + jellyfinUsrGrp = with config.services.jellyfin; "${user}:${group}"; transmissionUsrGrp = with config.services.transmission; "${user}:${group}"; in [ "${pkgs.coreutils}/bin/chown -R ${defaultUsrGrp} archive" "${pkgs.coreutils}/bin/chown -R ${defaultUsrGrp} backup" - # N.B.: /mnt/media/Music is used by Roon, not Plex - "${pkgs.coreutils}/bin/chown -R ${plexUsrGrp} media/Movies media/TV media/Video" + # N.B.: /mnt/media/Music is used by Roon, not Jellyfin + "${pkgs.coreutils}/bin/chown -R ${jellyfinUsrGrp} media/Movies media/TV media/Video" "${pkgs.coreutils}/bin/chown -R ${defaultUsrGrp} media/Music" "${pkgs.coreutils}/bin/chown -R ${transmissionUsrGrp} torrents" "${pkgs.coreutils}/bin/chown -R ${defaultUsrGrp} unsorted"