`sessions.stream { port, bind, openFirewall }` -- the piece of stage 3 that
does not need the broker. It exists because a machine had to be able to *reach*
a stream before the rest of the app is settled: the operator asked for the port
to be open on the deployment machine, where the app still runs by hand, and a
bare `networking.firewall.allowedTCPPorts` line in one machine's config is the
wrong place for a fact about this flake.
- `openFirewall` defaults false and is deliberately not implied by
`sessions.enable`: a live view of the desktop is readable by anyone who can
reach the port, the phrase in the URL is its only credential, and there is no
TLS. It opens exactly one port -- the one the option names.
- `bind` defaults to loopback and is *checked*: `openFirewall = true` beside a
loopback bind is refused, because that is a hole with no service behind it.
- `checks/vm-stream-firewall.nix` boots the module with a configured port that
is not the module's default, puts listeners on that port and on a neighbour,
and asserts from a second machine on the same VLAN that the peer reaches the
configured port and is refused on the other -- while both answer on loopback
inside the guest, so the refusal is the firewall's doing and not an empty
socket. The peer is a second machine because a probe from the test driver
proves nothing: the driver is not on the test VLAN.
Nothing here turns a stream on -- no unit, no phrases, no `session stream`
verbs, which stay stage 2+3 -- and docs/plans/2026-10-04-session-stream-webapp.md
now records which part of its stage 3 landed and why out of order.
64 lines
2.4 KiB
Nix
64 lines
2.4 KiB
Nix
# The flake's `checks` output. One file per check; this is only the wiring.
|
|
#
|
|
# unit -- pytest over tests/, 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
|
|
# vm-ipc -- the compositor's IPC sockets, and an event that arrives
|
|
# vm-containers -- one output and one workspace per session
|
|
# vm-pointer -- the lease, the driver, and a click the application saw
|
|
# vm-stream-firewall -- the stream's port in the guest's own running firewall
|
|
#
|
|
# What the guests need lives in checks/lib: `test-tools.nix` for the fake
|
|
# capture and the contract asserter, `session-tools.nix` for the event
|
|
# subscriber and the pointer target, `session-machine.nix` for the guest the
|
|
# three session checks share, and `session-prelude.nix` for their test-script
|
|
# helpers.
|
|
#
|
|
# Run them ONE AT A TIME. Each boots a VM with a software-rendered compositor;
|
|
# two at once on a two-core machine make the timing-sensitive assertions flake,
|
|
# and a flaky green is worth less than a slow one.
|
|
{
|
|
pkgs,
|
|
self,
|
|
system,
|
|
}:
|
|
let
|
|
hhstream = self.packages.${system}.hhstream;
|
|
hhsModule = self.nixosModules.default;
|
|
testTools = pkgs.callPackage ./lib/test-tools.nix { };
|
|
# The three session checks take the same five arguments; naming them once
|
|
# keeps a new check from being wired up with a different compositor or a
|
|
# different package than its neighbours.
|
|
sessionArgs = {
|
|
inherit hhstream hhsModule testTools;
|
|
};
|
|
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;
|
|
};
|
|
|
|
vm-ipc = pkgs.callPackage ./vm-ipc.nix sessionArgs;
|
|
|
|
vm-containers = pkgs.callPackage ./vm-containers.nix sessionArgs;
|
|
|
|
vm-pointer = pkgs.callPackage ./vm-pointer.nix sessionArgs;
|
|
|
|
# Not a `sessionArgs` consumer: this one is about the module's own options,
|
|
# not about the broker or the compositor (see the file's header).
|
|
vm-stream-firewall = pkgs.callPackage ./vm-stream-firewall.nix {
|
|
inherit hhstream hhsModule testTools;
|
|
};
|
|
}
|