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: 838df8b8ad ("stylix: improve `stylix.image` type (#1414)")

Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
(cherry picked from commit ca1bc329e9)
This commit is contained in:
NAHO 2026-01-08 20:55:49 +01:00
parent ebd522ea7c
commit 261d44273b

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.