feat(jupiter): shrink system closure for the 29G eMMC
Run immich and seerr as official images (their node/python stacks live in podman's graphroot on the array), ship only the firmware the board loads, and point jellyfin at intel-media-driver directly instead of hardware.graphics (mesa + llvm). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -65,13 +65,30 @@
|
||||
# next value: acpi -> bios -> cold -> efi.
|
||||
boot.kernelParams = [ "reboot=pci" ];
|
||||
|
||||
# ---- Closure size (29G eMMC holds two generations during a switch) ----
|
||||
# Only the firmware this board loads (i915 DMC + r8169), not all ~850M of linux-firmware.
|
||||
hardware.enableRedistributableFirmware = false;
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
hardware.firmware = [
|
||||
(pkgs.runCommand "jupiter-firmware" { } ''
|
||||
mkdir -p $out/lib/firmware/i915
|
||||
cp -r ${pkgs.linux-firmware}/lib/firmware/rtl_nic $out/lib/firmware/
|
||||
cp ${pkgs.linux-firmware}/lib/firmware/i915/bxt_* $out/lib/firmware/i915/
|
||||
'')
|
||||
];
|
||||
# Pins a ~200M nixpkgs source; the box is only ever deployed to, never built on.
|
||||
nixpkgs.flake.setFlakeRegistry = false;
|
||||
nixpkgs.flake.setNixPath = false;
|
||||
nix.settings.auto-optimise-store = true;
|
||||
|
||||
# ---- GPU (jellyfin hardware transcoding) ----
|
||||
# Apollo Lake N3450 / HD Graphics 500 (Gen9). i915 binds on its own, but VAAPI needs
|
||||
# the iHD userspace driver (Gen9; i965 is Gen8-only) or jellyfin-ffmpeg exits 251 on
|
||||
# every transcode with no clearer error than "FFmpeg exited with code 251" in the log.
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
extraPackages = [ pkgs.intel-media-driver ];
|
||||
# Apollo Lake N3450 / HD Graphics 500 (Gen9). VAAPI needs the iHD userspace driver
|
||||
# (Gen9; i965 is Gen8-only) or jellyfin-ffmpeg exits 251 on every transcode with no
|
||||
# clearer error than "FFmpeg exited with code 251" in the log. Pointed at directly
|
||||
# instead of via hardware.graphics, which drags in mesa + llvm (~850M) for nothing.
|
||||
systemd.services.jellyfin.environment = {
|
||||
LIBVA_DRIVER_NAME = "iHD";
|
||||
LIBVA_DRIVERS_PATH = "${pkgs.intel-media-driver}/lib/dri";
|
||||
};
|
||||
# ⚠️ Use VAAPI, not QSV, in jellyfin's UI — QSV needs an MFX runtime not safely
|
||||
# available for this Gen9 chip (only insecure/EOL options) and fails with exit 171.
|
||||
@@ -92,14 +109,14 @@
|
||||
options = [ "nofail" ]; # don't block boot if the array is degraded/absent
|
||||
};
|
||||
|
||||
# `nofail` alone isn't enough — mounts layered on the array (prowlarr/seerr binds)
|
||||
# `nofail` alone isn't enough — mounts layered on the array (the prowlarr bind)
|
||||
# are RequiredBy local-fs.target and can still trip Emergency Mode, which is a dead
|
||||
# end here (root locked, no ssh). Boot as far as possible instead; the array-backed
|
||||
# services carry RequiresMountsFor=/mnt/data so they still won't write to the eMMC.
|
||||
systemd.enableEmergencyMode = false;
|
||||
|
||||
# ---- Heavy state moved off the eMMC ----
|
||||
# A deploy holds two full closures (~9G each) on this 29G disk at once, so state
|
||||
# A deploy holds two full closures (~4G each) on this 29G disk at once, so state
|
||||
# that grows on its own can't live there — moved under /mnt/data/AppData like every
|
||||
# other service's state. Settings below are jupiter-only; services/containers.nix
|
||||
# stays engine/host-agnostic (mercury runs podman with no array).
|
||||
@@ -133,7 +150,7 @@
|
||||
|
||||
# Without this, podman would recreate an empty store on the eMMC if the array mounts
|
||||
# late or is absent, and the runner would re-pull every image.
|
||||
# (podman-clonarr already sets this in services/media/clonarr.nix.)
|
||||
# (the media containers set this in their own modules.)
|
||||
systemd.services.podman.unitConfig.RequiresMountsFor = [ "/mnt/data" ];
|
||||
systemd.services.gitea-runner-jupiter.unitConfig.RequiresMountsFor = [ "/mnt/data" ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user