diff --git a/modules/grub/nixos.nix b/modules/grub/nixos.nix index 195ea5a1..17b9a566 100644 --- a/modules/grub/nixos.nix +++ b/modules/grub/nixos.nix @@ -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" } diff --git a/stylix/palette.nix b/stylix/palette.nix index febefd32..44e339f1 100644 --- a/stylix/palette.nix +++ b/stylix/palette.nix @@ -83,7 +83,7 @@ in default = pkgs.runCommand "palette.json" { } '' ${lib.getExe cfg.paletteGenerator} \ "${cfg.polarity}" \ - ${cfg.image} \ + ${lib.escapeShellArg cfg.image} \ "$out" ''; }; diff --git a/stylix/testbed/images.nix b/stylix/testbed/images.nix index fd569b51..03e1aafc 100644 --- a/stylix/testbed/images.nix +++ b/stylix/testbed/images.nix @@ -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="; };