copyq: add option to disable XWayland

This commit is contained in:
Marcin Serwin 2024-12-28 11:16:56 +01:00 committed by GitHub
parent b7a7cd5dd1
commit 10e99c43cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 70 additions and 1 deletions

View file

@ -25,6 +25,13 @@ in {
otherwise the service may never be started.
'';
};
forceXWayland = lib.mkOption {
type = lib.types.bool;
default = true;
example = false;
description = "Force the CopyQ to use the X backend on wayland";
};
};
config = lib.mkIf cfg.enable {
@ -45,7 +52,7 @@ in {
Service = {
ExecStart = "${cfg.package}/bin/copyq";
Restart = "on-failure";
Environment = [ "QT_QPA_PLATFORM=xcb" ];
Environment = lib.optional cfg.forceXWayland "QT_QPA_PLATFORM=xcb";
};
Install = { WantedBy = [ cfg.systemdTarget ]; };