treewide: properly quote stylix.image when used as a shell argument

Closes: https://github.com/nix-community/stylix/issues/1720
Fixes: 218d4424b0 ("treewide: remove redundant stylix.image Nix store copies (#1659)")
This commit is contained in:
Daniel Thwaites 2025-07-23 12:32:21 +01:00 committed by NAHO
parent 37673b1de0
commit 3499e3ec70
No known key found for this signature in database
GPG key ID: BFB5D5E3F4C95185
3 changed files with 9 additions and 3 deletions

View file

@ -134,7 +134,11 @@ in
cfg.useWallpaper
# Make sure the background image is .png by asking to convert it
then
"${lib.getExe' pkgs.imagemagick "convert"} ${config.stylix.image} png32:$out/background.png"
''
${lib.getExe' pkgs.imagemagick "convert"} \
${lib.escapeShellArg config.stylix.image} \
"png32:$out/background.png"
''
else
"cp ${pixel "base00"} $out/background.png"
}

View file

@ -83,7 +83,7 @@ in
default = pkgs.runCommand "palette.json" { } ''
${lib.getExe cfg.paletteGenerator} \
"${cfg.polarity}" \
${cfg.image} \
${lib.escapeShellArg cfg.image} \
"$out"
'';
};

View file

@ -9,7 +9,9 @@
};
light = fetchurl {
name = "three-bicycles.jpg";
# Includes a space to make sure the path is properly quoted via
# `lib.escapeShellArg` when used as a shell argument.
name = "three bicycles.jpg";
url = "https://unsplash.com/photos/hwLAI5lRhdM/download?ixid=M3wxMjA3fDB8MXxhbGx8fHx8fHx8fHwxNzE2MzYxNDcwfA&force=true";
hash = "sha256-S0MumuBGJulUekoGI2oZfUa/50Jw0ZzkqDDu1nRkFUA=";
};