Compare commits
4 commits
362306faaa
...
296aa01b46
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
296aa01b46 | ||
|
|
a387b3ac6c | ||
|
|
63fa437f13 | ||
|
|
06d93928d4 |
3 changed files with 29 additions and 49 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<style-scheme id="stylix" _name="Stylix" version="1.0">
|
||||
<author>Stylix</author>
|
||||
<_description>Theme configured as part of your NixOS configuration.</_description>
|
||||
<_description>Theme configured via NixOS or Home Manager.</_description>
|
||||
|
||||
<color name="base00" value="#{{base00-hex}}"/>
|
||||
<color name="base01" value="#{{base01-hex}}"/>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ mkTarget {
|
|||
themes.${theme} = {
|
||||
theme = {
|
||||
accent = {
|
||||
dark = colors.withHashtag.base07;
|
||||
dark = colors.withHashtag.base0F;
|
||||
light = colors.withHashtag.base07;
|
||||
};
|
||||
background = {
|
||||
|
|
@ -72,7 +72,7 @@ mkTarget {
|
|||
light = colors.withHashtag.base03;
|
||||
};
|
||||
diffLineNumber = {
|
||||
dark = colors.withHashtag.base02;
|
||||
dark = colors.withHashtag.base03;
|
||||
light = colors.withHashtag.base04;
|
||||
};
|
||||
diffRemoved = {
|
||||
|
|
@ -97,26 +97,26 @@ mkTarget {
|
|||
};
|
||||
markdownBlockQuote = {
|
||||
dark = colors.withHashtag.base03;
|
||||
light = colors.withHashtag.base03;
|
||||
light = colors.withHashtag.base01;
|
||||
};
|
||||
markdownCode = {
|
||||
dark = colors.withHashtag.base0B;
|
||||
light = colors.withHashtag.base0B;
|
||||
};
|
||||
markdownCodeBlock = {
|
||||
dark = colors.withHashtag.base04;
|
||||
dark = colors.withHashtag.base01;
|
||||
light = colors.withHashtag.base00;
|
||||
};
|
||||
markdownEmph = {
|
||||
dark = colors.withHashtag.base09;
|
||||
dark = colors.withHashtag.base0A;
|
||||
light = colors.withHashtag.base09;
|
||||
};
|
||||
markdownHeading = {
|
||||
dark = colors.withHashtag.base0C;
|
||||
dark = colors.withHashtag.base0E;
|
||||
light = colors.withHashtag.base0F;
|
||||
};
|
||||
markdownHorizontalRule = {
|
||||
dark = colors.withHashtag.base03;
|
||||
dark = colors.withHashtag.base04;
|
||||
light = colors.withHashtag.base03;
|
||||
};
|
||||
markdownImage = {
|
||||
|
|
@ -124,7 +124,7 @@ mkTarget {
|
|||
light = colors.withHashtag.base0D;
|
||||
};
|
||||
markdownImageText = {
|
||||
dark = colors.withHashtag.base07;
|
||||
dark = colors.withHashtag.base0C;
|
||||
light = colors.withHashtag.base07;
|
||||
};
|
||||
markdownLink = {
|
||||
|
|
@ -132,31 +132,31 @@ mkTarget {
|
|||
light = colors.withHashtag.base0D;
|
||||
};
|
||||
markdownLinkText = {
|
||||
dark = colors.withHashtag.base07;
|
||||
dark = colors.withHashtag.base0C;
|
||||
light = colors.withHashtag.base07;
|
||||
};
|
||||
markdownListEnumeration = {
|
||||
dark = colors.withHashtag.base07;
|
||||
dark = colors.withHashtag.base0C;
|
||||
light = colors.withHashtag.base07;
|
||||
};
|
||||
markdownListItem = {
|
||||
dark = colors.withHashtag.base0C;
|
||||
dark = colors.withHashtag.base0D;
|
||||
light = colors.withHashtag.base0F;
|
||||
};
|
||||
markdownStrong = {
|
||||
dark = colors.withHashtag.base0A;
|
||||
dark = colors.withHashtag.base09;
|
||||
light = colors.withHashtag.base0A;
|
||||
};
|
||||
markdownText = {
|
||||
dark = colors.withHashtag.base04;
|
||||
dark = colors.withHashtag.base05;
|
||||
light = colors.withHashtag.base00;
|
||||
};
|
||||
primary = {
|
||||
dark = colors.withHashtag.base0C;
|
||||
dark = colors.withHashtag.base0D;
|
||||
light = colors.withHashtag.base0F;
|
||||
};
|
||||
secondary = {
|
||||
dark = colors.withHashtag.base0D;
|
||||
dark = colors.withHashtag.base0E;
|
||||
light = colors.withHashtag.base0D;
|
||||
};
|
||||
success = {
|
||||
|
|
@ -164,29 +164,29 @@ mkTarget {
|
|||
light = colors.withHashtag.base0B;
|
||||
};
|
||||
syntaxComment = {
|
||||
dark = colors.withHashtag.base03;
|
||||
dark = colors.withHashtag.base04;
|
||||
light = colors.withHashtag.base03;
|
||||
};
|
||||
syntaxFunction = {
|
||||
dark = colors.withHashtag.base0C;
|
||||
dark = colors.withHashtag.base0D;
|
||||
light = colors.withHashtag.base0C;
|
||||
};
|
||||
syntaxKeyword = {
|
||||
dark = colors.withHashtag.base0D;
|
||||
dark = colors.withHashtag.base0E;
|
||||
|
||||
light = colors.withHashtag.base0D;
|
||||
|
||||
};
|
||||
syntaxNumber = {
|
||||
dark = colors.withHashtag.base0E;
|
||||
dark = colors.withHashtag.base09;
|
||||
light = colors.withHashtag.base0E;
|
||||
};
|
||||
syntaxOperator = {
|
||||
dark = colors.withHashtag.base0D;
|
||||
dark = colors.withHashtag.base0C;
|
||||
light = colors.withHashtag.base0D;
|
||||
};
|
||||
syntaxPunctuation = {
|
||||
dark = colors.withHashtag.base04;
|
||||
dark = colors.withHashtag.base05;
|
||||
light = colors.withHashtag.base00;
|
||||
};
|
||||
syntaxString = {
|
||||
|
|
@ -194,7 +194,7 @@ mkTarget {
|
|||
light = colors.withHashtag.base0B;
|
||||
};
|
||||
syntaxType = {
|
||||
dark = colors.withHashtag.base07;
|
||||
dark = colors.withHashtag.base0A;
|
||||
light = colors.withHashtag.base07;
|
||||
};
|
||||
syntaxVariable = {
|
||||
|
|
@ -202,16 +202,16 @@ mkTarget {
|
|||
light = colors.withHashtag.base07;
|
||||
};
|
||||
text = {
|
||||
dark = colors.withHashtag.base04;
|
||||
dark = colors.withHashtag.base05;
|
||||
light = colors.withHashtag.base00;
|
||||
};
|
||||
textMuted = {
|
||||
dark = colors.withHashtag.base03;
|
||||
dark = colors.withHashtag.base04;
|
||||
light = colors.withHashtag.base01;
|
||||
};
|
||||
warning = {
|
||||
dark = colors.withHashtag.base09;
|
||||
light = colors.withHashtag.base09;
|
||||
dark = colors.withHashtag.base0A;
|
||||
light = colors.withHashtag.base0A;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,13 +17,8 @@
|
|||
follows:
|
||||
|
||||
```nix
|
||||
{ mkTarget, lib... }:
|
||||
{ mkTarget, lib, ... }:
|
||||
mkTarget {
|
||||
unconditionalConfig =
|
||||
lib.mkIf complexCondition {
|
||||
home.packages = [ pkgs.hello ];
|
||||
};
|
||||
|
||||
config = [
|
||||
{ programs.«name».theme.name = "stylix"; }
|
||||
|
||||
|
|
@ -125,11 +120,6 @@
|
|||
: The target name used to generate options in the `stylix.targets.${name}`
|
||||
namespace.
|
||||
|
||||
`unconditionalConfig` (Attribute set or function or path)
|
||||
: This argument mirrors the `config` argument but intentionally lacks
|
||||
automatic safeguarding and should only be used for complex configurations
|
||||
where `config` is unsuitable.
|
||||
|
||||
# Environment
|
||||
|
||||
The function is provided alongside module arguments in any modules imported
|
||||
|
|
@ -143,12 +133,6 @@
|
|||
# of modules:
|
||||
#
|
||||
# {
|
||||
# unconditionalConfig =
|
||||
# { lib, pkgs }:
|
||||
# lib.mkIf complexCondition {
|
||||
# home.packages = [ pkgs.hello ];
|
||||
# };
|
||||
#
|
||||
# config = [
|
||||
# { programs.example.theme.name = "stylix"; }
|
||||
#
|
||||
|
|
@ -182,7 +166,6 @@ in
|
|||
imports ? [ ],
|
||||
name ? name',
|
||||
options ? [ ],
|
||||
unconditionalConfig ? { },
|
||||
}@args:
|
||||
let
|
||||
mkTargetConfig = config;
|
||||
|
|
@ -341,10 +324,7 @@ let
|
|||
config.lib.stylix.mkEnableTargetWith enableArgs;
|
||||
|
||||
config = lib.mkIf (config.stylix.enable && cfg.enable) (
|
||||
lib.mkMerge (
|
||||
lib.singleton (callModule false unconditionalConfig)
|
||||
++ map (callModule true) normalizedConfig
|
||||
)
|
||||
lib.mkMerge (map (callModule true) normalizedConfig)
|
||||
);
|
||||
};
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue