From 3a4599a330a0bb1c544fe81e5f83b522f02c6106 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Thu, 29 May 2025 18:41:30 +0100 Subject: [PATCH] stylix: check base16Scheme is not null before using mkSchemeAttrs (#1408) Link: https://github.com/nix-community/stylix/pull/1408 Closes: https://github.com/nix-community/stylix/issues/1046 Closes: https://github.com/nix-community/stylix/issues/1385 Reviewed-by: awwpotato --- stylix/palette.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stylix/palette.nix b/stylix/palette.nix index afe12df0..ba8159a8 100644 --- a/stylix/palette.nix +++ b/stylix/palette.nix @@ -164,7 +164,14 @@ in config = { # This attrset can be used like a function too, see # https://github.com/SenchoPens/base16.nix/blob/b390e87cd404e65ab4d786666351f1292e89162a/README.md#theme-step-22 - lib.stylix.colors = (cfg.base16.mkSchemeAttrs cfg.base16Scheme).override cfg.override; + # + # NOTE: base16Scheme is nullable. If null, we cannot pass it to mkSchemeAttrs. + # See https://github.com/nix-community/stylix/pull/1408 + lib.stylix.colors = + if cfg.base16Scheme == null then + null + else + (cfg.base16.mkSchemeAttrs cfg.base16Scheme).override cfg.override; assertions = lib.mkIf cfg.enable [ {