copyq: add option to disable XWayland
This commit is contained in:
parent
b7a7cd5dd1
commit
10e99c43cd
7 changed files with 70 additions and 1 deletions
|
@ -25,6 +25,13 @@ in {
|
||||||
otherwise the service may never be started.
|
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 {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -45,7 +52,7 @@ in {
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${cfg.package}/bin/copyq";
|
ExecStart = "${cfg.package}/bin/copyq";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
Environment = [ "QT_QPA_PLATFORM=xcb" ];
|
Environment = lib.optional cfg.forceXWayland "QT_QPA_PLATFORM=xcb";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = { WantedBy = [ cfg.systemdTarget ]; };
|
Install = { WantedBy = [ cfg.systemdTarget ]; };
|
||||||
|
|
|
@ -243,6 +243,7 @@ in import nmtSrc {
|
||||||
./modules/services/cliphist
|
./modules/services/cliphist
|
||||||
./modules/services/clipman
|
./modules/services/clipman
|
||||||
./modules/services/comodoro
|
./modules/services/comodoro
|
||||||
|
./modules/services/copyq
|
||||||
./modules/services/conky
|
./modules/services/conky
|
||||||
./modules/services/darkman
|
./modules/services/darkman
|
||||||
./modules/services/devilspie2
|
./modules/services/devilspie2
|
||||||
|
|
17
tests/modules/services/copyq/basic-configuration.nix
Normal file
17
tests/modules/services/copyq/basic-configuration.nix
Normal 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}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
12
tests/modules/services/copyq/basic-expected.service
Normal file
12
tests/modules/services/copyq/basic-expected.service
Normal 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
|
4
tests/modules/services/copyq/default.nix
Normal file
4
tests/modules/services/copyq/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
copyq-basic-configuration = ./basic-configuration.nix;
|
||||||
|
copyq-dont-force-x = ./dont-force-x-configuration.nix;
|
||||||
|
}
|
17
tests/modules/services/copyq/dont-force-x-configuration.nix
Normal file
17
tests/modules/services/copyq/dont-force-x-configuration.nix
Normal 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}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
11
tests/modules/services/copyq/dont-force-x-expected.service
Normal file
11
tests/modules/services/copyq/dont-force-x-expected.service
Normal 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
|
Loading…
Reference in a new issue