11 Commits

Author SHA1 Message Date
finn.markwitz ae6c81bf54 fix(mibook): boot-menu terminal choice via specialisation
The previous startOnBoot approach booted mibook headless by default and
locked the machine out: it is WiFi-only with credentials in KWallet, so
with no desktop session NetworkManager never joins the network (no SSH),
and boot stalled on NetworkManager-wait-online with the tty1 prompt
buried under service logs.

Replace it with a NixOS specialisation that adds a separate 'terminal'
GRUB entry:
- default entry boots KDE as before (identical to baseline);
- 'terminal' entry boots multi-user.target with autologin for finn and a
  'desktop' command to start SDDM on demand.
Also disable NetworkManager-wait-online so boot never stalls on the
network. Revert the kde-desktop startOnBoot option.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfozKLQdUh5TzqyjSigLUx
2026-07-27 10:52:18 +02:00
finn.markwitz f01b1f2c4f Merge pull request 'Feat/jellyfin hw transcoding' (#3) from feat/jellyfin-hw-transcoding into main
Reviewed-on: #3
2026-07-27 09:56:11 +02:00
finn.markwitz ff34fe762e Merge pull request 'Feat/mibook boot desktop choice' (#4) from feat/mibook-boot-desktop-choice into main
Reviewed-on: #4
2026-07-27 09:55:47 +02:00
finn.markwitz 7e4407a1f8 feat(mibook): boot to terminal, launch KDE on demand
Add my.profiles.kde-desktop.startOnBoot (default true, no change for
existing consumers). When false, boot to multi-user.target, keep SDDM
out of any boot target's wants, and provide a 'desktop' command that
starts the display manager on demand. Enable this on mibook.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfozKLQdUh5TzqyjSigLUx
2026-07-27 09:48:13 +02:00
finn.markwitz 539fb26791 docs: spec for mibook boot-time terminal/desktop choice
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfozKLQdUh5TzqyjSigLUx
2026-07-27 09:27:37 +02:00
marthsincemelee 003a2f77dd docs: record post-deploy QSV/OpenCL runtime fixes in spec
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-26 17:42:41 +02:00
marthsincemelee 86e7f9c1a8 fix(jupiter): add Intel compute-runtime for OpenCL HDR tone-mapping
HDR HEVC transcodes were failing with "Failed to get number of OpenCL
platforms: -1001" (CL_PLATFORM_NOT_FOUND_KHR). The tonemap_opencl
filter jellyfin-ffmpeg uses for HDR-to-SDR tone-mapping needs an OpenCL
ICD, which intel-media-driver/vpl-gpu-rt don't provide on their own.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-26 17:34:36 +02:00
marthsincemelee adb7fcfad7 fix(jupiter): add oneVPL/MFX runtime for QSV hardware transcoding
HEVC HDR transcodes were failing with "Error creating a MFX session: -9"
because intel-media-driver only provides VAAPI, not the separate
oneVPL/MFX runtime QSV needs to create a hardware session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-26 17:27:31 +02:00
finn.markwitz 79b26ddfda chore: Flake Update 2026-07-24 12:01:15 +02:00
finn.markwitz b8961fb47d Merge pull request 'feat(mibook): do nothing on lid close while on AC power' (#2) from feat/mibook-lid-close-ac into main
Reviewed-on: #2
2026-07-24 11:56:02 +02:00
finn.markwitz 4851f745d8 feat(mibook): do nothing on lid close while on AC power
Ship a system-wide PowerDevil default (/etc/xdg/powerdevilrc) setting the
AC lid-close action to "do nothing" (LidAction=0). Battery behavior is left
at the default (suspend).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbZoyXq6J8v2eqC9yn5Vcy
2026-07-21 17:42:47 +02:00
6 changed files with 198 additions and 17 deletions
@@ -106,3 +106,40 @@ show up as low CPU, some GPU (`intel_gpu_top`) activity instead.
- Exact supported codec list depends on the iGPU generation (device ID - Exact supported codec list depends on the iGPU generation (device ID
`9a49`) — confirm via `vainfo` output once run, and enable only the `9a49`) — confirm via `vainfo` output once run, and enable only the
hardware decode paths it actually reports. hardware decode paths it actually reports.
## Post-deploy fix: two additional runtime packages required
After the initial deploy (Task 1's `SupplementaryGroups` grant) and
enabling QSV in the dashboard, HEVC HDR playback hung indefinitely
(Direct Play worked for some titles; titles that needed a real
transcode+tonemap never produced output). Root-caused via
`journalctl -u jellyfin` and the per-session ffmpeg transcode log
(`find / -xdev -iname '*ffmpeg-transcode*'`) — two separate runtimes
were missing beyond `intel-media-driver` (which only provides VAAPI):
1. **QSV session creation failed:** `Error creating a MFX session: -9`
/ `Error initializing an MFX session: -3` on
`-init_hw_device qsv=qs@va`. VAAPI and QSV are separate runtimes on
Linux — QSV needs the oneVPL/MFX GPU implementation. Fix: added
`pkgs.vpl-gpu-rt` ("oneAPI Video Processing Library Intel GPU
implementation"; note `onevpl-intel-gpu` is the old, renamed
attribute) to `hardware.graphics.extraPackages` in
`machines/jupiter/hardware-configuration.nix`.
2. **OpenCL device creation failed:** `Failed to get number of OpenCL
platforms: -1001` (`CL_PLATFORM_NOT_FOUND_KHR`) on
`-init_hw_device opencl=ocl@va`. The `tonemap_opencl` filter jellyfin
uses for HDR→SDR tone-mapping needs a working OpenCL ICD, which
nothing installed so far provides. Fix: added
`pkgs.intel-compute-runtime` ("Intel Graphics Compute Runtime oneAPI
Level Zero and OpenCL, supporting 12th Gen and newer" — matches
jupiter's Tiger Lake/Xe iGPU) to the same `extraPackages` list.
Confirmed working end-to-end: HEVC HDR transcode with QSV encode +
OpenCL tone-map runs at `speed=2.68x` realtime on jupiter's iGPU, and
plays smoothly on Apple TV (JellyTV app).
Both packages live in `machines/jupiter/hardware-configuration.nix`
(`hardware.graphics.extraPackages`), alongside `intel-media-driver`,
rather than in the jellyfin module itself — they're iGPU runtime
capabilities, not something specific to the jellyfin service.
@@ -0,0 +1,105 @@
# mibook: choose terminal-only vs desktop at boot
## Goal
Let mibook offer a choice, each time it boots, between the normal KDE desktop
and a terminal-only ("server") mode with no graphical session — decided at
boot, without rebuilding the system.
## Background: why the first attempt failed
The first implementation booted mibook to a text console by default
(`systemd.defaultUnit = "multi-user.target"`, display manager not started) and
provided a `desktop` command to start KDE on demand. On real hardware this
locked the machine out:
- **No SSH.** mibook is WiFi-only and its WiFi credentials are stored per-user
in KWallet ("agent-owned"). NetworkManager only receives the password once a
desktop session is running, so a headless boot never joins the network and
the machine has no IP — nothing to SSH into.
- **No usable console.** The boot appeared to "hang" with no login prompt:
`NetworkManager-wait-online` stalled waiting for a network that never came
up, and the `getty` login prompt on tty1 was buried under later service
messages.
Conclusion: a headless WiFi laptop cannot be reached remotely, and the plain
console was hard to use. The design must (a) keep the desktop as the reliable
default, (b) make the terminal path a deliberate, self-sufficient choice, and
(c) not depend on the network being up.
## Behavior
- The **default GRUB entry** boots straight into KDE — unchanged from the
known-working baseline.
- A **separate GRUB entry, `mibook (terminal)`** (a NixOS *specialisation*),
boots to a text console with **autologin** for `finn`. From there the user
can work in the shell or run `desktop` to bring KDE up (via SDDM).
- The choice is made in the GRUB menu at boot — matching the original request
to "decide each time I boot."
- Booting never stalls on the network.
### Known limitation (documented, not fixed in config)
In terminal mode WiFi will not connect on its own, because the password is
stored per-user in KWallet. To reach mibook over SSH from terminal mode, the
user must first save the WiFi as a **system** connection in KDE:
network settings → the WiFi network → "All users may connect to this network".
Until then, terminal mode is local-console-only. This is a one-time manual
step outside the scope of the Nix config.
## Implementation
### `machines/mibook/configuration.nix`
- Add a NixOS specialisation `specialisation.terminal.configuration`:
- `system.nixos.tags = [ "terminal" ];` — labels the generated boot entry.
- `systemd.defaultUnit = lib.mkForce "multi-user.target";` — boots to the
text console. `graphical.target` is what pulls in the display manager (via
its embedded `Wants=display-manager.service`), so defaulting to
`multi-user.target` leaves SDDM installed but not started at boot.
- `services.getty.autologinUser = "finn";` — guarantees a usable shell on
the console instead of a login prompt that can scroll off screen.
- A `desktop` command via
`pkgs.writeShellScriptBin "desktop" "exec sudo systemctl start display-manager.service"`
in `environment.systemPackages`, to start KDE on demand.
- Add `systemd.services.NetworkManager-wait-online.enable = false;` (applies to
both the default and terminal boots) so boot never stalls waiting for the
network.
### Reverted from the first attempt
- `modules/environments/kde-desktop/default.nix` — remove the `startOnBoot`
option and its `mkMerge`/`mkIf` machinery; back to the original profile that
simply enables SDDM + Plasma 6.
- `machines/mibook/environments.nix` — remove `kde-desktop.startOnBoot = false;`
(back to just `kde-desktop.enable = true;`).
## Why a specialisation
A specialisation generates a second boot-menu entry automatically from a
modified copy of the configuration. It is the idiomatic NixOS mechanism for a
boot-time choice and avoids fragile hand-written GRUB `extraEntries` that would
need to track kernel/initrd paths across generations. The default entry remains
byte-for-byte the working desktop configuration.
## Testing / verification
- `nix build '.#nixosConfigurations.mibook.config.system.build.toplevel'`
builds both `nixos-system-mibook` and `nixos-system-mibook-terminal`.
- Verified on the built closures:
- Parent `default.target``graphical.target`; no console autologin
(identical to the pre-change baseline).
- Specialisation `default.target``multi-user.target`; tty1 getty wrapper
contains `--autologin finn`; `desktop` present in the system profile.
- `NetworkManager-wait-online` disabled in both.
- Post-`switch` manual check on mibook: default GRUB entry boots to KDE; the
`terminal` entry boots to an autologged-in console; running `desktop` there
starts SDDM and a working Plasma session.
## Trade-offs
- Autologin on the terminal console means physical access grants a shell
without a password. Acceptable for a personal laptop the user controls; the
desktop (default) boot is unaffected.
- `desktop` relies on `sudo`; the user has sudo access, so no extra config is
required.
Generated
+14 -14
View File
@@ -89,11 +89,11 @@
"nixpkgs-regression": "nixpkgs-regression" "nixpkgs-regression": "nixpkgs-regression"
}, },
"locked": { "locked": {
"lastModified": 1784375420, "lastModified": 1784762557,
"narHash": "sha256-dt1zVj4MRpmffhsgQk+3tx1m/pFTXbtVWrn5KZ1y+8Q=", "narHash": "sha256-R/r6jRnANV50c8F5Fz5+1Q1moab0IGWRk+cg5ME2nMY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nix", "repo": "nix",
"rev": "bebd2f851a304e9fb2e143ce0cbeff577c6a37ac", "rev": "d10c84cd0cc0efdcb29cf2611caf5fbcd10fa071",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -143,11 +143,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1784310968, "lastModified": 1784723954,
"narHash": "sha256-rkSPTePrKqs4dg+i7ZFCq93+HrClac6oSwXX927SVjA=", "narHash": "sha256-1CfD8ZUjCkTgjsneLZ/lxCHhgDfqxxE7/GX0MmsgiqA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "779c32a00155994c86cde8213a8dd4df139d4355", "rev": "a017f5b72210026af5b3ac5949f08d94380a6fbd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -218,11 +218,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1784497964, "lastModified": 1784796856,
"narHash": "sha256-WhdsTtaih3DgTPP/PX023b36UNQyMzEoi6GkPyGx0y4=", "narHash": "sha256-vwxWgF+Gj276WznzGb1LxGsK/39HaQwgQXiU3EkC844=",
"rev": "241313f4e8e508cb9b13278c2b0fa25b9ca27163", "rev": "e2587caef70cea85dd97d7daab492899902dbf5d",
"type": "tarball", "type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1037713.241313f4e8e5/nixexprs.tar.xz" "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1040357.e2587caef70c/nixexprs.tar.xz"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
@@ -245,11 +245,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1784432872, "lastModified": 1784707089,
"narHash": "sha256-IX7j5TvSD7hYC9NZ8mgmq7pZ97mYyl24Qs4Tz4uyvO4=", "narHash": "sha256-DUedXhD2Rg8q4Xyd07Sb90eZGy4gg6W+Vl/WbLNwAZo=",
"rev": "fd1462031fdee08f65fd0b4c6b64e22239a77870", "rev": "b3fe9581c9061c749abef42b6d4ee7b7c05c33fa",
"type": "tarball", "type": "tarball",
"url": "https://releases.nixos.org/nixos/26.05/nixos-26.05.5591.fd1462031fde/nixexprs.tar.xz" "url": "https://releases.nixos.org/nixos/26.05/nixos-26.05.5845.b3fe9581c906/nixexprs.tar.xz"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
@@ -35,6 +35,8 @@
#vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) #vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libva-vdpau-driver libva-vdpau-driver
libvdpau-va-gl libvdpau-va-gl
vpl-gpu-rt # oneVPL/MFX runtime, required for QSV (h264_qsv/hevc_qsv) session creation
intel-compute-runtime # OpenCL runtime, required for tonemap_opencl (HDR tone-mapping)
]; ];
}; };
+39 -2
View File
@@ -20,7 +20,6 @@
useOSProber = true; useOSProber = true;
}; };
# Configure keymap in X11 # Configure keymap in X11
services.xserver.xkb = { services.xserver.xkb = {
layout = "de"; layout = "de";
@@ -34,7 +33,6 @@
services.printing.enable = true; services.printing.enable = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
hardware.nvidia.prime = { hardware.nvidia.prime = {
sync.enable = false; sync.enable = false;
@@ -44,6 +42,45 @@
services.openssh.enable = true; services.openssh.enable = true;
# Don't let boot stall waiting for a network that may never come up
# (WiFi credentials live in KWallet and need a desktop session), which
# otherwise hangs the terminal boot before the login prompt appears.
systemd.services.NetworkManager-wait-online.enable = false;
# Boot-time choice: the default GRUB entry boots straight into KDE.
# A separate "terminal" entry (a NixOS specialisation) boots to a text
# console with autologin, where you can work or run `desktop` to bring
# KDE up. Pick the entry you want in the GRUB menu at boot.
#
# NOTE: in terminal mode WiFi will not connect on its own (the password
# is stored per-user in KWallet). To reach the machine over SSH from
# terminal mode, first save the WiFi as a system connection in KDE:
# network settings -> your WiFi -> "All users may connect to this network".
specialisation.terminal.configuration = {
system.nixos.tags = [ "terminal" ];
# Boot to a text console. graphical.target is what pulls in the display
# manager (via its embedded Wants=display-manager.service), so defaulting
# to multi-user.target leaves SDDM installed but not started at boot.
systemd.defaultUnit = lib.mkForce "multi-user.target";
# Guarantee a usable shell on the console (no login prompt to hunt for).
services.getty.autologinUser = "finn";
# Bring the desktop up on demand from the terminal.
environment.systemPackages = [
(pkgs.writeShellScriptBin "desktop" "exec sudo systemctl start display-manager.service")
];
};
# KDE (PowerDevil) power settings: do nothing on lid close while on AC power.
# Shipped as a system-wide default; KConfig cascades so a user's own
# ~/.config/powerdevilrc will override this if present.
environment.etc."xdg/powerdevilrc".text = ''
[AC][SuspendAndShutdown]
LidAction=0
'';
system = { system = {
stateVersion = "23.05"; stateVersion = "23.05";
autoUpgrade.enable = true; autoUpgrade.enable = true;