mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-15 05:12:28 +01:00
komorebi-for-kde/nix/ -> nix/linux/ komorebi-for-mac/nix/ -> nix/macos/ The nix expressions of the platforms (modules, option files, VM test suites, kwin effects, the darwin module) sit next to the existing nix/workspace-src.nix. Renames only (252 files); the flakes that import them are replaced by one root flake later in this stack, so nix does not evaluate at this revision.
71 lines
2.7 KiB
Nix
71 lines
2.7 KiB
Nix
# A real Plasma Wayland session that logs in by itself, on a machine that can draw. Everything the
|
|
# headless node has is here too, so a test can still start a virtual KWin next to it. The module's
|
|
# unit, `komorebi.service`, starts komorebi in the session when the user logs in, as on a user's
|
|
# machine; a suite that wants the session without it sets `services.komorebi.enable = false` in
|
|
# its `node`.
|
|
#
|
|
# The choice of login manager is made here and nowhere else. nixpkgs' own `plasma6` test uses
|
|
# plasma-login-manager, so that is what this node follows; sddm with a Wayland greeter is the other
|
|
# one that has been seen to work, and replacing the first block below with
|
|
# `services.displayManager.sddm = { enable = true; wayland.enable = true; };` and
|
|
# `services.displayManager.defaultSession = "plasma";` switches to it.
|
|
{ pkgs, ... }:
|
|
{
|
|
imports = [ ./headless.nix ];
|
|
|
|
# the one display this node has is the one screenshots are taken of
|
|
komorebi.vm.renderNode = false;
|
|
|
|
services.xserver.enable = true;
|
|
services.displayManager = {
|
|
plasma-login-manager.enable = true;
|
|
autoLogin = {
|
|
enable = true;
|
|
user = "komorebi";
|
|
};
|
|
};
|
|
|
|
virtualisation = {
|
|
memorySize = 4096;
|
|
cores = 4;
|
|
};
|
|
|
|
# An idle lock screen or a dimmed display changes what a screenshot shows, and a display that has
|
|
# gone to sleep gets no frame callbacks from KWin, so clients stop answering resizes.
|
|
environment.etc."xdg/kscreenlockerrc".text = ''
|
|
[Daemon]
|
|
Autolock=false
|
|
LockOnResume=false
|
|
'';
|
|
environment.etc."xdg/powerdevilrc".text = ''
|
|
[AC][Display]
|
|
DimDisplayWhenIdle=false
|
|
TurnOffDisplayWhenIdle=false
|
|
|
|
[AC][SuspendAndShutdown]
|
|
AutoSuspendAction=0
|
|
'';
|
|
|
|
# A pointer device the test drives from inside the guest (`komorebi_vm.Pointer`): the program
|
|
# makes it with uinput, which the test user may open.
|
|
hardware.uinput.enable = true;
|
|
users.users.komorebi.extraGroups = [ "uinput" ];
|
|
|
|
environment.systemPackages = [
|
|
pkgs.kdePackages.konsole
|
|
(pkgs.writeScriptBin "komorebi-pointer" ''
|
|
#!${pkgs.python3.interpreter}
|
|
${builtins.readFile ../lib/komorebi_vm/uinput.py}
|
|
'')
|
|
];
|
|
|
|
# KWin loads no effect that animates under software rendering, which is all a guest has, unless
|
|
# it is told to: with this it loads Geometry Change, which komorebi asks it to load
|
|
environment.sessionVariables.KWIN_EFFECTS_FORCE_ANIMATIONS = "1";
|
|
|
|
# Nothing adds a display device here (see komorebi.vm.renderNode above). The test driver gives
|
|
# every aarch64 guest a virtio-gpu, and an x86_64 guest has the default VGA; screenshots are taken
|
|
# of that one, and a second device would be a second head that KWin draws on and the screenshot
|
|
# never shows.
|
|
}
|