Compare commits
No commits in common. "cff8f40bb09163909702eb66df1aea1c2c5c0940" and "7a3ecf1545878271b03200515469b0a73121c856" have entirely different histories.
cff8f40bb0
...
7a3ecf1545
4 changed files with 14 additions and 15 deletions
|
|
@ -17,7 +17,6 @@ let
|
||||||
"moonfly"
|
"moonfly"
|
||||||
"nord"
|
"nord"
|
||||||
"oxocarbon"
|
"oxocarbon"
|
||||||
"generate-from-image"
|
|
||||||
];
|
];
|
||||||
# schemes names in `pkgs.base16-schemes` that need a suffix
|
# schemes names in `pkgs.base16-schemes` that need a suffix
|
||||||
needsSuffix = [
|
needsSuffix = [
|
||||||
|
|
@ -31,6 +30,11 @@ let
|
||||||
];
|
];
|
||||||
schemeName =
|
schemeName =
|
||||||
if builtins.elem cfg.scheme needsSuffix then "${cfg.scheme}-${cfg.polarity}" else cfg.scheme;
|
if builtins.elem cfg.scheme needsSuffix then "${cfg.scheme}-${cfg.polarity}" else cfg.scheme;
|
||||||
|
scheme =
|
||||||
|
if builtins.elem cfg.scheme customSchemes then
|
||||||
|
./schemes/${schemeName}.yaml
|
||||||
|
else
|
||||||
|
"${pkgs.base16-schemes}/share/themes/${schemeName}.yaml";
|
||||||
|
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
mkDefault
|
mkDefault
|
||||||
|
|
@ -47,13 +51,13 @@ in
|
||||||
|
|
||||||
options.stylix = {
|
options.stylix = {
|
||||||
scheme = lib.mkOption {
|
scheme = lib.mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
default = "dracula";
|
default = "dracula";
|
||||||
description = ''
|
description = ''
|
||||||
Base16 color scheme name. Available options are:
|
Base16 color scheme name. Available options are:
|
||||||
${toString validSchemes}
|
${toString validSchemes}
|
||||||
|
|
||||||
"generate-from-image" generates a color scheme from `stylix.image`
|
Set to `null` to generate a color scheme from `stylix.image`
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -64,16 +68,15 @@ in
|
||||||
assertion = builtins.elem cfg.scheme validSchemes;
|
assertion = builtins.elem cfg.scheme validSchemes;
|
||||||
message = "Stylix: Invalid colorscheme '${cfg.scheme}'. Available options: ${toString 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 = {
|
stylix = {
|
||||||
autoEnable = mkDefault true;
|
autoEnable = mkDefault true;
|
||||||
base16Scheme = mkIf (cfg.scheme != "generate-from-image") (
|
base16Scheme = mkIf (cfg.scheme != null) scheme;
|
||||||
if builtins.elem cfg.scheme customSchemes then
|
|
||||||
./schemes/${schemeName}.yaml
|
|
||||||
else
|
|
||||||
"${pkgs.base16-schemes}/share/themes/${schemeName}.yaml"
|
|
||||||
);
|
|
||||||
fonts = {
|
fonts = {
|
||||||
monospace = mkDefault {
|
monospace = mkDefault {
|
||||||
package = pkgs.hack-font;
|
package = pkgs.hack-font;
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,11 @@ let
|
||||||
cfg = config.stylix;
|
cfg = config.stylix;
|
||||||
target = cfg.targets.nixvim;
|
target = cfg.targets.nixvim;
|
||||||
|
|
||||||
inherit (lib) mkIf optionalAttrs;
|
inherit (lib) mkIf;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
stylix.targets.nixvim.enable = false;
|
stylix.targets.nixvim.enable = false;
|
||||||
programs.nixvim.colorschemes = optionalAttrs (cfg.scheme != "generate-from-image") {
|
programs.nixvim.colorschemes."${cfg.scheme}".enable = !target.enable;
|
||||||
"${cfg.scheme}".enable = !target.enable;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
stylix.enable = true;
|
stylix.enable = true;
|
||||||
stylix.scheme = "generate-from-image";
|
|
||||||
stylix.image = ./wallpaper.png;
|
|
||||||
|
|
||||||
home.stateVersion = "25.11";
|
home.stateVersion = "25.11";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 MiB |
Loading…
Add table
Add a link
Reference in a new issue