diff options
author | K900 <me@0upti.me> | 2023-07-08 12:00:23 +0300 |
---|---|---|
committer | K900 <me@0upti.me> | 2023-10-03 12:48:58 +0300 |
commit | 76917ca3ae8fa50e49f774176e8d9b112aa00680 (patch) | |
tree | 93007b0ce04af41860a0037f073beeee47cd4d69 /nixos/modules | |
parent | d6537416aa7533e3138dae0e712f0ca4190116f8 (diff) | |
download | nixlib-76917ca3ae8fa50e49f774176e8d9b112aa00680.tar nixlib-76917ca3ae8fa50e49f774176e8d9b112aa00680.tar.gz nixlib-76917ca3ae8fa50e49f774176e8d9b112aa00680.tar.bz2 nixlib-76917ca3ae8fa50e49f774176e8d9b112aa00680.tar.lz nixlib-76917ca3ae8fa50e49f774176e8d9b112aa00680.tar.xz nixlib-76917ca3ae8fa50e49f774176e8d9b112aa00680.tar.zst nixlib-76917ca3ae8fa50e49f774176e8d9b112aa00680.zip |
nixos/sddm: add option to enable Wayland support via Weston
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/x11/display-managers/sddm.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/display-managers/sddm.nix b/nixos/modules/services/x11/display-managers/sddm.nix index 47e60236eaeb..25470e2d3c2f 100644 --- a/nixos/modules/services/x11/display-managers/sddm.nix +++ b/nixos/modules/services/x11/display-managers/sddm.nix @@ -33,6 +33,8 @@ let # Implementation is done via pkgs/applications/display-managers/sddm/sddm-default-session.patch DefaultSession = optionalString (dmcfg.defaultSession != null) "${dmcfg.defaultSession}.desktop"; + + DisplayServer = if cfg.wayland.enable then "wayland" else "x11"; }; Theme = { @@ -62,6 +64,7 @@ let Wayland = { EnableHiDPI = cfg.enableHidpi; SessionDir = "${dmcfg.sessionData.desktops}/share/wayland-sessions"; + CompositorCommand = lib.optionalString cfg.wayland.enable cfg.wayland.compositorCommand; }; } // lib.optionalAttrs dmcfg.autoLogin.enable { Autologin = { @@ -184,6 +187,32 @@ in ''; }; }; + + # Experimental Wayland support + wayland = { + enable = mkEnableOption "experimental Wayland support"; + + compositorCommand = mkOption { + type = types.str; + internal = true; + + # This is basically the upstream default, but with Weston referenced by full path + # and the configuration generated from NixOS options. + default = let westonIni = (pkgs.formats.ini {}).generate "weston.ini" { + libinput = { + enable-tap = xcfg.libinput.mouse.tapping; + left-handed = xcfg.libinput.mouse.leftHanded; + }; + keyboard = { + keymap_model = xcfg.xkbModel; + keymap_layout = xcfg.layout; + keymap_variant = xcfg.xkbVariant; + keymap_options = xcfg.xkbOptions; + }; + }; in "${pkgs.weston}/bin/weston --shell=fullscreen-shell.so -c ${westonIni}"; + description = lib.mdDoc "Command used to start the selected compositor"; + }; + }; }; }; |