This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

machines.coaxmetal: strom gamepad kiosk + auto max brightness

Autostart the strom couch launcher fullscreen via services.cage on boot
(after LUKS unlock), always pulling the newest launcher with nix run.
Dedicated strom kiosk user; force backlight to max on boot and let the
video group adjust brightness via brightnessctl udev rules.

+72
+1
machines/coaxmetal/config.nix
··· 17 17 ../../2configs/wine.nix 18 18 ../../2configs/yellow-mounts/samba.nix 19 19 ../../2configs/review.nix 20 + ./strom.nix 20 21 ./hermes.nix 21 22 ]; 22 23
+71
machines/coaxmetal/strom.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + let 8 + # Always pull the newest launcher straight from the public flake instead of 9 + # pinning it as an input, so the game grid tracks upstream on every (re)launch. 10 + # The launcher itself only shells out to `nix run <flake>#<slug>` per game, so 11 + # its closure stays tiny; games bring their own nested gamescope/proton. 12 + strom-session = pkgs.writeShellScript "strom-session" '' 13 + set -u 14 + # Relaunch whenever the couch launcher exits (gamepad B / Esc) so the kiosk 15 + # never drops to a blank tty. Keeping the loop as cage's child means the 16 + # compositor stays up across relaunches. 17 + while true; do 18 + ${config.nix.package}/bin/nix run --refresh github:kraftwerk-gaming/strom#scripts.launcher 19 + sleep 2 20 + done 21 + ''; 22 + in 23 + { 24 + # Dedicated, unprivileged kiosk user. Gamepad input comes through evdev 25 + # (input group), audio through the system-wide pipewire socket (pipewire 26 + # group), and the games need video/audio like any local player. 27 + users.users.strom = { 28 + isNormalUser = true; 29 + extraGroups = [ 30 + "video" 31 + "audio" 32 + "input" 33 + "pipewire" 34 + ]; 35 + }; 36 + 37 + # Kiosk autostart. After the initrd ZFS/LUKS unlock hands off to the running 38 + # system, graphical.target pulls up cage on tty1, which logs the strom user 39 + # in with no prompt and runs the fullscreen launcher as its sole Wayland 40 + # client. This is the canonical NixOS single-app kiosk path. 41 + services.cage = { 42 + enable = true; 43 + user = "strom"; 44 + program = strom-session; 45 + }; 46 + 47 + # Recover the compositor itself if it ever crashes (the session loop above 48 + # already handles a launcher exit without tearing cage down). 49 + systemd.services.cage-tty1.serviceConfig = { 50 + Restart = lib.mkDefault "always"; 51 + RestartSec = 2; 52 + }; 53 + 54 + # The panel comes up at ~1% backlight, unreadable for a couch setup. Ship 55 + # brightnessctl + its udev rules (chgrp backlight to the video group, g+w) so 56 + # any video-group user (strom, lass) can adjust it without root, e.g. 57 + # `brightnessctl set 100%` / `brightnessctl set 50%`. 58 + environment.systemPackages = [ pkgs.brightnessctl ]; 59 + services.udev.packages = [ pkgs.brightnessctl ]; 60 + 61 + # Force the backlight to maximum on every boot. Ordered after 62 + # systemd-backlight, which would otherwise restore the last (dim) saved level. 63 + systemd.services.max-brightness = { 64 + wantedBy = [ "multi-user.target" ]; 65 + after = [ "systemd-backlight@backlight:amdgpu_bl1.service" ]; 66 + serviceConfig = { 67 + Type = "oneshot"; 68 + ExecStart = "${pkgs.brightnessctl}/bin/brightnessctl set 100%"; 69 + }; 70 + }; 71 + }