File tree Expand file tree Collapse file tree 4 files changed +52
-3
lines changed
tests/modules/programs/vivid Expand file tree Collapse file tree 4 files changed +52
-3
lines changed Original file line number Diff line number Diff line change 8080 } ;
8181
8282 themes = mkOption {
83- type = with types ; attrsOf path ;
83+ type = with types ; attrsOf ( either path yamlFormat . type ) ;
8484 default = { } ;
8585 example = lib . literalExpression ''
8686 {
9393 url = "https://raw.githubusercontent.com/NearlyTRex/Vivid/refs/heads/master/themes/catppuccin-mocha.yml";
9494 hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
9595 };
96+
97+ my-custom-theme = {
98+ colors = {
99+ blue = "0000ff";
100+ };
101+ core = {
102+ directory = {
103+ foreground = "blue";
104+ font-style = "bold";
105+ };
106+ };
107+ };
96108 }
97109 '' ;
98- description = "Theme for vivid" ;
110+ description = ''
111+ An attribute set of vivid themes.
112+ Each value can either be a path to a theme file or an attribute set
113+ defining the theme directly (which will be converted from Nix to YAML).
114+ '' ;
99115 } ;
116+
100117 } ;
101118
102119 config =
116133 } ;
117134 }
118135 // ( lib . mapAttrs' (
119- name : path : lib . nameValuePair "vivid/themes/${ name } .yml" { source = path ; }
136+ name : value :
137+ lib . nameValuePair "vivid/themes/${ name } .yml" {
138+ source = if lib . isAttrs value then yamlFormat . generate "${ name } .yml" value else value ;
139+ }
120140 ) cfg . themes ) ;
121141
122142 programs . bash . initExtra = mkIf cfg . enableBashIntegration ''
Original file line number Diff line number Diff line change 2626 themes = {
2727 ayu = ./themes/ayu.yml ;
2828 mocha = ./themes/mocha.yml ;
29+ tiny = import ./themes/tiny.nix ;
2930 } ;
3031 } ;
3132
4142 assertFileExists home-files/.config/vivid/themes/mocha.yml
4243 assertFileContent home-files/.config/vivid/themes/mocha.yml \
4344 ${ ./themes/mocha.yml }
45+
46+ assertFileExists home-files/.config/vivid/themes/tiny.yml
47+ assertFileContent home-files/.config/vivid/themes/tiny.yml \
48+ ${ ./themes/tiny.yml }
4449 '' ;
4550}
Original file line number Diff line number Diff line change 1+ {
2+ colors = {
3+ primary = "00aaff" ;
4+ secondary = "ff00aa" ;
5+ } ;
6+ core = {
7+ directory = {
8+ foreground = "primary" ;
9+ } ;
10+ "executable-file" = {
11+ foreground = "secondary" ;
12+ "font-style" = "bold" ;
13+ } ;
14+ } ;
15+ }
Original file line number Diff line number Diff line change 1+ colors :
2+ primary : 00aaff
3+ secondary : ff00aa
4+ core :
5+ directory :
6+ foreground : primary
7+ executable-file :
8+ font-style : bold
9+ foreground : secondary
You can’t perform that action at this time.
0 commit comments