Skip to content

Claude/gpu vm config simplify 2iq62m - #4

Merged
PhysShell merged 5 commits into
mainfrom
claude/gpu-vm-config-simplify-2iq62m
Sep 7, 2026
Merged

Claude/gpu vm config simplify 2iq62m#4
PhysShell merged 5 commits into
mainfrom
claude/gpu-vm-config-simplify-2iq62m

Conversation

@PhysShell

Copy link
Copy Markdown
Owner

No description provided.

claude and others added 5 commits September 7, 2026 07:41
…ify kiosk

Windows side
- qubixctl.ps1: `up` is the default and idempotent (create-if-missing,
  start/resume, wait for RDP, connect); new `connect`, `fetch`, `manifest`;
  `recreate` keeps the home disk, `destroy -Purge` removes it.
- Images come from GitHub release assets by default (SHA256-verified, gzip
  unpacked with .NET), from WSL with -ImageSource wsl, or from local files.
- Reads the committed manifest.json; regenerates it live from Nix only in
  the WSL developer loop.  Strict mode, PS 5.1 + 7, approved verbs.
- qubix-up.cmd: double-click launcher that elevates itself.
- Generated .rdp (windowed, audio on host, clipboard only) plus a saved
  TERMSRV credential so the click needs no prompts.

Nix side
- profiles/storage/persistent-home.nix: /home on a labelled VHDX, needed
  for boot; users get pinned UIDs so the persistent home never changes owner.
- spotibox-home-vhdx: pre-formatted ext4 seed as dynamic VHDX.
- profiles/remote/xrdp.nix + qubix.session.command: xrdp runs the session
  the active profiles choose; spotify.nix ships a kiosk Openbox rc.xml and
  a spotibox-session script (undecorated, maximised Spotify; quitting it
  ends the session).
- Manifest v2 (machines/, homeDisk, rdp, release), pretty-printed and
  committed; nixosConfigurations exported and evaluated with the Hyper-V
  image module.
- spotibox-release bundles gz images + manifest + SHA256SUMS for CI.

CI
- ci.yml: flake check, manifest drift, PSScriptAnalyzer, unit checks on
  Windows PowerShell 5.1 and pwsh.
- release.yml: builds the bundle with KVM on tag push and attaches it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VN8NjBJm5XEucv6JBL8KRZ
Two defects that keep this branch from working outside the cloud sandbox:

1. `.github/workflows/ci.yml` never compiled. A step's own `shell:` accepts
   no contexts at all, so `shell: ${{ matrix.shell }}` made GitHub reject the
   whole workflow: run 34096684564 failed in 0s with no jobs, and the workflow
   is still registered under its path instead of its `name:`. Job-level
   `defaults.run` does accept the matrix context, so the value moves there.
   Verified with actionlint, which flags the original and passes the fix.

2. There was no `.gitattributes`. Git for Windows defaults to
   core.autocrlf=true, so a Windows clone gets CRLF in every `.nix` file. Nix
   embeds those contents verbatim into derivation build scripts, bash then
   reads the CR as a command, and the build dies:

       qubix-openbox-rc.xml.drv: builder failed with exit code 127
       > /build/.attr-...: line 1: $'\r': command not found

   That made `nix build .#spotibox-release` impossible from a Windows clone,
   and made the "manifest.json matches Nix" check report a false mismatch on
   every line. Normalising to LF in the working tree fixes both; the CMD
   entry points stay CRLF because cmd.exe needs it for multi-line blocks.

After this, on a Windows host: flake check passes, the release bundle builds,
manifest.json matches Nix, 42/42 controller checks pass under both PowerShell
5.1 and pwsh 7, and PSScriptAnalyzer is clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Audio redirection was silent on Windows for a reason that hides well: nixpkgs
builds xrdp with `--enable-mp3lame` and `--enable-opus`, mstsc then negotiates
WAVE_FORMAT_MPEGLAYER3, and drops the stream. Everything inside the guest looks
healthy while this happens, which is why it reads as a configuration problem
and is not one:

    - pulseaudio xrdp-sink loaded
    - pulseaudio xrdp-sink set as default
    Connected ok fd 17
    sound_process_training: round trip time 0
    Socket 19: connection accepted from AF_UNIX

The sink is default, unmuted, at 100%, and cycles IDLE -> RUNNING in step with
the track. Only the host is silent, and the Windows mixer shows an mstsc slider
that never moves. chansrv names the culprit outright:

    sound_process_output_format:
          wFormatNo       2
          wFormatTag      WAVE_FORMAT_MPEGLAYER3

Dropping both encoders leaves PCM, which every RDP client decodes; ~176 kB/s is
nothing beside the video channel this appliance already pushes.

The override is an overlay rather than `services.xrdp.package`, because that
option does not work: the NixOS module declares it, then hardcodes `pkgs.xrdp`
in the ExecStart of xrdp.service and xrdp-sesman.service. Setting the option
rebuilds confDir only, and the daemons keep running the unmodified build --
confirmed on the host, where the override built as expected and the guest still
executed /nix/store/1fsy7...-xrdp. Worth reporting upstream separately.

Verified end to end on a Windows 11 host with Hyper-V: `nix flake check` passes,
the rebuilt xrdp links neither libmp3lame nor libopus, xrdp-sesman resolves to
the overridden package, chansrv offers WAVE_FORMAT_PCM only with zero
MPEGLAYER3 lines in its log, and audio is audible in the mstsc window.

README gains a Continuous Integration section (triggers, jobs, gh commands,
and the actionlint tip for workflows GitHub refuses to compile) plus a
"Why PCM-only audio" design note.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The overlay here works around a nixpkgs bug, and that bug already has an open
fix: NixOS/nixpkgs#452303, "nixos/xrdp: actually use cfg.package parameter",
two approvals, unmerged since October 2025. It covers one more call site than
this repo had found -- xrdp-keygen in ExecStartPre -- besides the two ExecStart
lines.

Record the link in both the profile and the design note so that whoever revisits
this can drop the overlay for a plain services.xrdp.package assignment once the
fix lands, instead of rediscovering why it is an overlay at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fix CI compile error and unbreak Nix builds from Windows clones
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 16d8a7b4-c9c7-44db-8cb8-56f758cf96c5


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PhysShell
PhysShell merged commit 602ec47 into main Sep 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants