diff --git a/modules/home/stylix/default.nix b/modules/home/stylix/default.nix index 34fd04f..9d79091 100644 --- a/modules/home/stylix/default.nix +++ b/modules/home/stylix/default.nix @@ -51,11 +51,13 @@ in options.stylix = { scheme = lib.mkOption { - type = types.str; + type = types.nullOr types.str; default = "dracula"; description = '' Base16 color scheme name. Available options are: ${toString validSchemes} + + Set to `null` to generate a color scheme from `stylix.image` ''; }; }; @@ -66,11 +68,15 @@ in assertion = builtins.elem cfg.scheme validSchemes; message = "Stylix: Invalid colorscheme '${cfg.scheme}'. Available options: ${toString validSchemes}"; } + { + assertion = (cfg.scheme != null) || (cfg.image != null); + message = "Stylix: You need to set stylix.image if stylix.scheme is `null`"; + } ]; stylix = { autoEnable = mkDefault true; - base16Scheme = scheme; + base16Scheme = mkIf (cfg.scheme != null) scheme; fonts = { monospace = mkDefault { package = pkgs.hack-font;