stylix/palette: allow impure absolute stylix.image path (#2150)

Allow an impure absolute stylix.image path for end-user convenience by
relaxing the guarantees established in commits ca1bc329e9
("stylix/palette: coerce derivations to store paths") and 61c9f4dd14
("treewide: remove redundant stylix.image escaping and string
coercion").

When stylix.image cannot be copied to the store, it is not guaranteed to
be a stringified store path with a valid string context and no special
characters, resulting in UB.

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

Reviewed-by: Matt Sturgeon <matt@sturgeon.me.uk>
Reviewed-by: 0xda157 <da157@voidq.com>
This commit is contained in:
NAHO 2026-01-26 19:33:11 +01:00 committed by GitHub
parent 296aa01b46
commit 05e53b52b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,7 +29,14 @@ in
image = lib.mkOption {
# Ensure the path is copied to the store
type = with lib.types; nullOr (coercedTo path (src: "${src}") pathInStore);
type =
with lib.types;
nullOr (
coercedTo path (src: "${src}") path
// {
inherit (path) description descriptionClass;
}
);
description = ''
Wallpaper image.