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:
commit
3894cae75c
3 changed files with 7 additions and 13 deletions
|
|
@ -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;
|
||||
}
|
||||
)
|
||||
(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ mkTarget {
|
|||
{
|
||||
services.hyprpaper.settings.wallpaper = lib.singleton {
|
||||
monitor = "";
|
||||
path = toString image;
|
||||
path = image;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue