1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2025-01-11 03:29:50 +01:00

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 ]; };

View file

@ -243,6 +243,7 @@ in import nmtSrc {
./modules/services/cliphist
./modules/services/clipman
./modules/services/comodoro
./modules/services/copyq
./modules/services/conky
./modules/services/darkman
./modules/services/devilspie2

View file

@ -0,0 +1,17 @@
{ ... }:
{
config = {
services.copyq = {
enable = true;
systemdTarget = "sway-session.target";
};
test.stubs.copyq = { };
nmt.script = ''
serviceFile=home-files/.config/systemd/user/copyq.service
assertFileContent $serviceFile ${./basic-expected.service}
'';
};
}

View file

@ -0,0 +1,12 @@
[Install]
WantedBy=sway-session.target
[Service]
Environment=QT_QPA_PLATFORM=xcb
ExecStart=@copyq@/bin/copyq
Restart=on-failure
[Unit]
After=graphical-session.target
Description=CopyQ clipboard management daemon
PartOf=graphical-session.target

View file

@ -0,0 +1,4 @@
{
copyq-basic-configuration = ./basic-configuration.nix;
copyq-dont-force-x = ./dont-force-x-configuration.nix;
}

View file

@ -0,0 +1,17 @@
{ ... }:
{
config = {
services.copyq = {
enable = true;
forceXWayland = false;
};
test.stubs.copyq = { };
nmt.script = ''
serviceFile=home-files/.config/systemd/user/copyq.service
assertFileContent $serviceFile ${./dont-force-x-expected.service}
'';
};
}

View file

@ -0,0 +1,11 @@
[Install]
WantedBy=graphical-session.target
[Service]
ExecStart=@copyq@/bin/copyq
Restart=on-failure
[Unit]
After=graphical-session.target
Description=CopyQ clipboard management daemon
PartOf=graphical-session.target