mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
98cef4c273
- rename hardware.opengl to hardware.graphics - remove hardware.opengl.driSupport, which does nothing - remove hardware.opengl.setLdLibraryPath, which should never be done - rename hardware.opengl.driSupport32Bit to hardware.graphics.enable32Bit - lost of small docs / formatting cleanups
52 lines
1.3 KiB
Nix
52 lines
1.3 KiB
Nix
import ./make-test-python.nix ({ pkgs, lib, ... }:
|
|
|
|
let
|
|
seatd-test = pkgs.writeShellApplication {
|
|
name = "seatd-client-pid";
|
|
text = ''
|
|
journalctl -u seatd --no-pager -b | while read -r line; do
|
|
case "$line" in
|
|
*"New client connected"*)
|
|
line="''${line##*pid: }"
|
|
pid="''${line%%,*}"
|
|
;;
|
|
*"Opened client"*)
|
|
echo "$pid"
|
|
exit
|
|
esac
|
|
done;
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
name = "seatd";
|
|
meta.maintainers = with lib.maintainers; [ sinanmohd ];
|
|
|
|
nodes.machine = { ... }: {
|
|
imports = [ ./common/user-account.nix ];
|
|
services.getty.autologinUser = "alice";
|
|
users.users.alice.extraGroups = [ "seat" "wheel" ];
|
|
|
|
fonts.enableDefaultPackages = true;
|
|
environment.systemPackages = with pkgs; [
|
|
dwl
|
|
foot
|
|
seatd-test
|
|
];
|
|
|
|
programs.bash.loginShellInit = ''
|
|
[ "$(tty)" = "/dev/tty1" ] &&
|
|
dwl -s 'foot touch /tmp/foot_started'
|
|
'';
|
|
|
|
hardware.graphics.enable = true;
|
|
virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ];
|
|
services.seatd.enable = true;
|
|
};
|
|
|
|
testScript = ''
|
|
machine.wait_for_file("/tmp/foot_started")
|
|
machine.succeed("test $(seatd-client-pid) = $(pgrep dwl)")
|
|
'';
|
|
})
|