fix(nixos): open the seat through seatd and narrow the package source

In the VM the compositor failed to open the GPU: as a user service it is
outside the tty1 login session, so logind refused it the device and the
console stayed on screen. Run seatd for the seat group the session user
is in and point the compositor's libseat at it.

The package source now holds only what the build reads, so editing the
VM configuration no longer rebuilds Servo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS8QcxvhVJwU3X2qhPamUW
This commit is contained in:
Marco Allegretti 2026-10-11 09:34:46 +00:00
parent 5ea2cfae57
commit 538c752d80
No known key found for this signature in database
2 changed files with 20 additions and 7 deletions

View file

@ -64,6 +64,14 @@
};
services.dbus.enable = true;
# The compositor runs as a user service, outside the tty1 login session,
# so logind does not hand it the seat's devices; seatd does, to members of
# its group.
services.seatd = {
enable = true;
group = "seat";
};
services.udev.packages = [ pkgs.libinput ];
environment.systemPackages = with pkgs; [
@ -111,6 +119,7 @@
# units after it; a restarted compositor must not inherit it, or an
# X11 DISPLAY, or it would pick the nested backend.
UnsetEnvironment = "WAYLAND_DISPLAY DISPLAY";
Environment = "LIBSEAT_BACKEND=seatd";
Restart = "on-failure";
RestartSec = "1";
};

View file

@ -6,13 +6,17 @@ let
rustc = rust193;
};
# The workspace without build outputs, so a local `target/` never enters
# the store.
src = lib.cleanSourceWith {
src = lib.cleanSource ../..;
filter = path: _type:
let rel = lib.removePrefix (toString ../.. + "/") (toString path);
in !(lib.hasPrefix "target" rel || lib.hasSuffix "-result" rel);
# Only what the build reads, so editing the VM's configuration or the
# docs does not rebuild Servo.
src = lib.fileset.toSource {
root = ../..;
fileset = lib.fileset.unions [
../../Cargo.toml
../../Cargo.lock
../../crates
../../protocol
../../infra/shell
];
};
servoHash = "sha256-L5XlHf5GOoPtyitRsbb+keXSkTMSJWmYCrWCHzGFI5M=";