Skip to content

Commit

Permalink
Merge pull request #242009 from K900/sddm-wayland
Browse files Browse the repository at this point in the history
nixos/sddm: enable Wayland support
  • Loading branch information
K900 authored Oct 3, 2023
2 parents 0e82139 + 76917ca commit 08751df
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
29 changes: 29 additions & 0 deletions nixos/modules/services/x11/display-managers/sddm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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";
};
};
};
};

Expand Down
21 changes: 20 additions & 1 deletion pkgs/applications/display-managers/sddm/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ mkDerivation, lib, fetchFromGitHub
{ mkDerivation, lib, fetchFromGitHub, fetchpatch
, cmake, extra-cmake-modules, pkg-config, qttools
, libxcb, libXau, pam, qtbase, qtdeclarative, qtquickcontrols2, systemd, xkeyboardconfig
}:
Expand All @@ -16,6 +16,25 @@ mkDerivation rec {
patches = [
./sddm-ignore-config-mtime.patch
./sddm-default-session.patch

# FIXME: all of the following are Wayland related backports, drop in next release
# Don't use Qt virtual keyboard on Wayland
(fetchpatch {
url = "https://github.com/sddm/sddm/commit/07631f2ef00a52d883d0fd47ff7d1e1a6bc6358f.patch";
hash = "sha256-HTSw3YeT4z9ldr4sLmsnrPQ+LA8/a6XxrF+KUFqXUlM=";
})

# Fix running sddm-greeter manually in Wayland sessions
(fetchpatch {
url = "https://github.com/sddm/sddm/commit/e27b70957505dc7b986ab2fa68219af546c63344.patch";
hash = "sha256-6hzrFeS2epL9vzLOA29ZA/dD3Jd4rPMBHhNp+FBq1bA=";
})

# Prefer GreeterEnvironment over PAM environment
(fetchpatch {
url = "https://github.com/sddm/sddm/commit/9e7791d5fb375933d20f590daba9947195515b26.patch";
hash = "sha256-JNsVTJNZV6T+SPqPkaFf3wg8NDqXGx8NZ4qQfZWOli4=";
})
];

postPatch = ''
Expand Down

0 comments on commit 08751df

Please sign in to comment.