From 838df8b8ad7d993d4de4af144f57bca0d5d1329a Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Fri, 30 May 2025 01:13:13 +0100 Subject: [PATCH] stylix: improve `stylix.image` type (#1414) Previously: - Out-of-store paths were not necessarily copied to store. - Derivations were needlessly coerced to strings. - `package` and `path` were both used, despite `path` being a superset of `package`. Link: https://github.com/nix-community/stylix/pull/1414 Reviewed-by: awwpotato Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- stylix/palette.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stylix/palette.nix b/stylix/palette.nix index ba8159a8..0ae7bf47 100644 --- a/stylix/palette.nix +++ b/stylix/palette.nix @@ -29,7 +29,10 @@ in }; image = lib.mkOption { - type = with lib.types; nullOr (coercedTo package toString path); + 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}"; description = '' Wallpaper image.