diff --git a/modules/services/parcellite.nix b/modules/services/parcellite.nix index a5cf8859..39b81e86 100644 --- a/modules/services/parcellite.nix +++ b/modules/services/parcellite.nix @@ -50,7 +50,7 @@ in { Service = { ExecStart = "${cfg.package}/bin/${cfg.package.pname} ${ - lib.concatStringsSep " " cfg.extraOptions + escapeShellArgs cfg.extraOptions }"; Restart = "on-abort"; }; diff --git a/tests/default.nix b/tests/default.nix index 21ae251d..1459f86b 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -185,6 +185,7 @@ import nmt { ./modules/services/mpd ./modules/services/mpdris2 ./modules/services/pantalaimon + ./modules/services/parcellite ./modules/services/pbgopy ./modules/services/picom ./modules/services/playerctld diff --git a/tests/modules/services/parcellite/default.nix b/tests/modules/services/parcellite/default.nix new file mode 100644 index 00000000..5cf326b1 --- /dev/null +++ b/tests/modules/services/parcellite/default.nix @@ -0,0 +1 @@ +{ parcellite = ./parcellite.nix; } diff --git a/tests/modules/services/parcellite/parcellite-expected.service b/tests/modules/services/parcellite/parcellite-expected.service new file mode 100644 index 00000000..02d8243a --- /dev/null +++ b/tests/modules/services/parcellite/parcellite-expected.service @@ -0,0 +1,13 @@ +[Install] +WantedBy=graphical-session.target + +[Service] +ExecStart=@parcellite@/bin/parcellite '--no-icon' +Restart=on-abort + +[Unit] +After=graphical-session-pre.target +After=tray.target +Description=Lightweight GTK+ clipboard manager +PartOf=graphical-session.target +Requires=tray.target diff --git a/tests/modules/services/parcellite/parcellite.nix b/tests/modules/services/parcellite/parcellite.nix new file mode 100644 index 00000000..25e553bc --- /dev/null +++ b/tests/modules/services/parcellite/parcellite.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ + services.parcellite = { + enable = true; + package = config.lib.test.mkStubPackage { + name = "parcellite"; + outPath = "@parcellite@"; + }; + extraOptions = [ "--no-icon" ]; + }; + + nmt.script = '' + assertFileContent \ + "home-files/.config/systemd/user/parcellite.service" \ + ${./parcellite-expected.service} + ''; +}