treewide: remove redundant stylix.image escaping and string coercion (#2134)

Link: https://github.com/nix-community/stylix/pull/2134

Reviewed-by: Matt Sturgeon <matt@sturgeon.me.uk>
This commit is contained in:
NAHO 2026-01-14 16:08:12 +01:00 committed by GitHub
commit 3894cae75c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 13 deletions

View file

@ -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;
}
)
(

View file

@ -5,7 +5,7 @@ mkTarget {
{
services.hyprpaper.settings.wallpaper = lib.singleton {
monitor = "";
path = toString image;
path = image;
};
};
}

View file

@ -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.
@ -80,12 +78,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 {