add wayland-proxy-virtwl module
This commit is contained in:
parent
8ee72ba5fa
commit
9dfc3f9613
@ -19,6 +19,7 @@
|
|||||||
meshnamed = import ./meshnamed nixosTestArgs;
|
meshnamed = import ./meshnamed nixosTestArgs;
|
||||||
borgbackup = import ./borgbackup nixosTestArgs;
|
borgbackup = import ./borgbackup nixosTestArgs;
|
||||||
syncthing = import ./syncthing nixosTestArgs;
|
syncthing = import ./syncthing nixosTestArgs;
|
||||||
|
wayland-proxy-virtwl = import ./wayland-proxy-virtwl nixosTestArgs;
|
||||||
};
|
};
|
||||||
schemaTests = pkgs.callPackages ./schemas.nix {
|
schemaTests = pkgs.callPackages ./schemas.nix {
|
||||||
inherit self;
|
inherit self;
|
||||||
|
29
checks/wayland-proxy-virtwl/default.nix
Normal file
29
checks/wayland-proxy-virtwl/default.nix
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import ../lib/test-base.nix ({ config, pkgs, lib, ... }: {
|
||||||
|
name = "wayland-proxy-virtwl";
|
||||||
|
|
||||||
|
nodes.machine = { self, ... }: {
|
||||||
|
imports = [
|
||||||
|
self.nixosModules.clanCore
|
||||||
|
{
|
||||||
|
clanCore.machineName = "machine";
|
||||||
|
clanCore.clanDir = ./.;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
services.wayland-proxy-virtwl.enable = true;
|
||||||
|
|
||||||
|
virtualisation.qemu.options = [
|
||||||
|
"-vga none -device virtio-gpu-rutabaga,cross-domain=on,hostmem=4G,wsi=headless"
|
||||||
|
];
|
||||||
|
virtualisation.qemu.package = lib.mkForce self.packages.${pkgs.hostPlatform.system}.qemu-wayland;
|
||||||
|
};
|
||||||
|
# FIXME: currently we still see this error in the build sandbox,
|
||||||
|
# but it gives us some smoke test
|
||||||
|
# vm-test-run-wayland-proxy-virtwl> machine # qemu-kvm: The errno is ENOENT: No such file or directory
|
||||||
|
# vm-test-run-wayland-proxy-virtwl> machine # qemu-kvm: CHECK failed in rutabaga_cmd_submit_3d() ../hw/display/virtio-gpu-rutabaga.c:341
|
||||||
|
# vm-test-run-wayland-proxy-virtwl> machine # qemu-kvm: virtio_gpu_rutabaga_process_cmd: ctrl 0x207, error 0x1200
|
||||||
|
testScript = ''
|
||||||
|
start_all()
|
||||||
|
# use machinectl
|
||||||
|
machine.succeed("machinectl shell .host ${config.nodes.machine.systemd.package}/bin/systemctl --user start wayland-proxy-virtwl >&2")
|
||||||
|
'';
|
||||||
|
})
|
@ -12,6 +12,7 @@
|
|||||||
./schema.nix
|
./schema.nix
|
||||||
./secrets
|
./secrets
|
||||||
./vm.nix
|
./vm.nix
|
||||||
|
./wayland-proxy-virtwl.nix
|
||||||
./zerotier
|
./zerotier
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
43
nixosModules/clanCore/wayland-proxy-virtwl.nix
Normal file
43
nixosModules/clanCore/wayland-proxy-virtwl.nix
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{ pkgs, config, lib, ... }:
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
# maybe upstream this?
|
||||||
|
services.wayland-proxy-virtwl = {
|
||||||
|
enable = lib.mkEnableOption "wayland-proxy-virtwl";
|
||||||
|
package = lib.mkPackageOption pkgs "wayland-proxy-virtwl" { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf config.services.wayland-proxy-virtwl.enable {
|
||||||
|
programs.xwayland.enable = lib.mkDefault true;
|
||||||
|
environment.etc."X11/xkb".source = config.services.xserver.xkb.dir;
|
||||||
|
|
||||||
|
environment.sessionVariables = {
|
||||||
|
WAYLAND_DISPLAY = "wayland-1";
|
||||||
|
DISPLAY = ":0";
|
||||||
|
QT_QPA_PLATFORM = "wayland"; # Qt Applications
|
||||||
|
GDK_BACKEND = "wayland"; # GTK Applications
|
||||||
|
XDG_SESSION_TYPE = "wayland"; # Electron Applications
|
||||||
|
SDL_VIDEODRIVER = "wayland";
|
||||||
|
CLUTTER_BACKEND = "wayland";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Is there a better way to do this?
|
||||||
|
programs.bash.loginShellInit = ''
|
||||||
|
if [ "$(tty)" = "/dev/ttyS0" ]; then
|
||||||
|
systemctl --user start graphical-session.target
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
systemd.user.services.wayland-proxy-virtwl = {
|
||||||
|
description = "Wayland proxy for virtwl";
|
||||||
|
before = [ "graphical-session.target" ];
|
||||||
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${config.services.wayland-proxy-virtwl.package}/bin/wayland-proxy-virtwl --virtio-gpu --x-display=0 --xwayland-binary=${pkgs.xwayland}/bin/Xwayland";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 5;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user