awww: remove blank space after awww-daemon when extraArgs is empty

awww: split graphical-session-target test into awww-default and awww-extraArgs
This commit is contained in:
Yiheng He
2026-04-05 00:03:10 +08:00
committed by Austin Horstman
parent 5b6f55b784
commit 5ee3b3ef63
5 changed files with 27 additions and 4 deletions

View File

@@ -57,7 +57,12 @@ in
};
Service = {
ExecStart = "${lib.getExe' cfg.package "${cfg.package.meta.mainProgram}-daemon"} ${lib.escapeShellArgs cfg.extraArgs}";
ExecStart = lib.escapeShellArgs (
[
(lib.getExe' cfg.package "${cfg.package.meta.mainProgram}-daemon")
]
++ cfg.extraArgs
);
Environment = [
"PATH=$PATH:${lib.makeBinPath [ cfg.package ]}"
];

View File

@@ -0,0 +1,16 @@
{ config, ... }:
{
services.awww = {
enable = true;
package = config.lib.test.mkStubPackage {
name = "awww";
outPath = "@awww@";
};
};
nmt.script = ''
serviceFile=home-files/.config/systemd/user/awww.service
assertFileExists $serviceFile
assertFileContent $serviceFile ${./awww-default.service}
'';
}

View File

@@ -3,7 +3,7 @@ WantedBy=graphical-session.target
[Service]
Environment=PATH=$PATH:@awww@/bin
ExecStart=@awww@/bin/awww-daemon --no-cache --layer bottom
ExecStart=@awww@/bin/awww-daemon
Restart=always
RestartSec=10

View File

@@ -15,6 +15,7 @@
nmt.script = ''
serviceFile=home-files/.config/systemd/user/awww.service
assertFileContent $serviceFile ${./awww-graphical-session-target.service}
assertFileExists $serviceFile
assertFileContains $serviceFile "ExecStart=@awww@/bin/awww-daemon --no-cache --layer bottom";
'';
}

View File

@@ -1,6 +1,7 @@
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
awww-graphical-session-target = ./awww-graphical-session-target.nix;
awww-default = ./awww-default.nix;
awww-extraArgs = ./awww-extraArgs.nix;
awww-swww-package = ./awww-swww-package.nix;
}