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>
This commit is contained in:
NAHO 2026-01-08 20:55:49 +01:00
parent 3f6651a26e
commit ca1bc329e9
No known key found for this signature in database
GPG key ID: BFB5D5E3F4C95185

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.