From 3f6651a26e0127654e6b24a3616239e2eaaf392b Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Fri, 9 Jan 2026 19:39:44 +0100 Subject: [PATCH 1/3] stylix/palette: use derivation arguments instead of string interpolation Co-authored-by: Matt Sturgeon --- stylix/palette.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/stylix/palette.nix b/stylix/palette.nix index 44e339f1..9e72a67e 100644 --- a/stylix/palette.nix +++ b/stylix/palette.nix @@ -80,12 +80,10 @@ in # and not anything indirect such as filling a template, otherwise # the output of the palette generator will not be protected from # garbage collection. - default = pkgs.runCommand "palette.json" { } '' - ${lib.getExe cfg.paletteGenerator} \ - "${cfg.polarity}" \ - ${lib.escapeShellArg cfg.image} \ - "$out" - ''; + default = pkgs.runCommand "palette.json" { + inherit (cfg) image polarity; + nativeBuildInputs = [ cfg.paletteGenerator ]; + } ''palette-generator "$polarity" "$image" "$out"''; }; palette = lib.mkOption { From ca1bc329e91039435450d19c0e31655c1efd3f0f Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Thu, 8 Jan 2026 20:55:49 +0100 Subject: [PATCH 2/3] stylix/palette: coerce derivations to store paths Coerce derivations to store paths to ensure non-null values are stringified store paths with valid string contexts. Fixes: 838df8b8ad7d ("stylix: improve `stylix.image` type (#1414)") Co-authored-by: Matt Sturgeon --- stylix/palette.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stylix/palette.nix b/stylix/palette.nix index 9e72a67e..260f850f 100644 --- a/stylix/palette.nix +++ b/stylix/palette.nix @@ -28,10 +28,8 @@ in }; image = lib.mkOption { - type = lib.types.nullOr lib.types.path; # Ensure the path is copied to the store - apply = - value: if value == null || lib.isDerivation value then value else "${value}"; + type = with lib.types; nullOr (coercedTo path (src: "${src}") pathInStore); description = '' Wallpaper image. From 61c9f4dd1435e0723fe675d44459a88b9203418d Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Thu, 8 Jan 2026 21:18:36 +0100 Subject: [PATCH 3/3] treewide: remove redundant stylix.image escaping and string coercion Remove redundant shell escaping and string coercion as stylix.image is guaranteed to be a stringified store path with a valid string context and no special characters. Fixes: 3499e3ec704b ("treewide: properly quote stylix.image when used as a shell argument") --- modules/hyprlock/hm.nix | 4 +--- modules/hyprpaper/hm.nix | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/hyprlock/hm.nix b/modules/hyprlock/hm.nix index 74c54a9c..8c59fa38 100644 --- a/modules/hyprlock/hm.nix +++ b/modules/hyprlock/hm.nix @@ -11,9 +11,7 @@ mkTarget { ( { cfg, image }: { - programs.hyprlock.settings.background.path = lib.mkIf cfg.useWallpaper "${ - image - }"; + programs.hyprlock.settings.background.path = lib.mkIf cfg.useWallpaper image; } ) ( diff --git a/modules/hyprpaper/hm.nix b/modules/hyprpaper/hm.nix index 7e6ee898..4bb02791 100644 --- a/modules/hyprpaper/hm.nix +++ b/modules/hyprpaper/hm.nix @@ -5,7 +5,7 @@ mkTarget { { services.hyprpaper.settings.wallpaper = lib.singleton { monitor = ""; - path = toString image; + path = image; }; }; }