M0 of the sessions design, wired into the flake and gated by a real check. What is here now: - `src/hhstreamd/` — the broker: session registry, lifecycle verbs, process-group teardown, app allowlist, audit log, idle reaper on CLOCK_BOOTTIME. - `src/hhstream_session/` — the CLI handlers, registered into the one front door. - `src/hhstream/cli.py` — `hhstream status|shot|run|record|session …`, so the frame verbs and the session namespace are one binary. - `nix/module.nix` — `sessions.*` options and the `hhstream-sessions.service` unit: the operator's own account (never a service account, because launched applications should see that account's home), the compositor's group as a supplementary group (without it a launched GUI client cannot open the Wayland socket), the generated app allowlist, and `--compositor-runtime-dir` so applications are handed the compositor's session rather than the broker's. - `checks/vm-sessions.nix` — 18 subtests on a real compositor in a VM. Two bugs found by driving it, both fixed: - BUG-01: launched applications could not reach the compositor at all — the broker spawned them with its own inherited environment, which names the login session. `hhstreamd/compositor.py` discovers the socket and builds the child environment; a directory with no usable socket is a startup refusal, not a warning. - BUG-02: `kill` refused to signal a live application and said nothing was wrong. The identity gate hashed `/proc/<pid>/cmdline`, which every `execve` replaces — and on NixOS applications are reached through wrapper scripts that do exactly that. The gate now rests on `starttime` (+ boot id, + session id where it is immutable) and records command-line drift as evidence of nothing. KillMode=process is set on the unit on purpose: the default control-group kill would take the applications down with the broker, which would make adoption and a broker restart pointless.
34 lines
991 B
Nix
34 lines
991 B
Nix
# The flake's `checks` output. One file per check; this is only the wiring.
|
|
#
|
|
# unit -- pytest over tests/unit/, against the nix/package.nix build
|
|
# vm-basic -- nixosTest with a fake capture backend: module + wire contract
|
|
# vm-hyprland -- nixosTest with the real compositor and grim
|
|
# vm-sessions -- nixosTest with the real compositor and the session broker
|
|
#
|
|
# Everything the guests need lives in checks/lib/test-tools.nix.
|
|
{
|
|
pkgs,
|
|
self,
|
|
system,
|
|
}:
|
|
let
|
|
hhstream = self.packages.${system}.hhstream;
|
|
hhsModule = self.nixosModules.default;
|
|
testTools = pkgs.callPackage ./lib/test-tools.nix { };
|
|
in
|
|
{
|
|
unit = pkgs.callPackage ./unit.nix { inherit hhstream; };
|
|
|
|
vm-basic = pkgs.callPackage ./vm-basic.nix {
|
|
inherit hhstream hhsModule testTools;
|
|
};
|
|
|
|
vm-hyprland = pkgs.callPackage ./vm-hyprland.nix {
|
|
inherit hhstream hhsModule testTools;
|
|
};
|
|
|
|
vm-sessions = pkgs.callPackage ./vm-sessions.nix {
|
|
inherit hhstream hhsModule testTools;
|
|
};
|
|
}
|