Home : Use lib.generators for configs.

This commit is contained in:
Dmitry Voronin 2024-06-18 11:07:11 +03:00
parent b4fcc953f9
commit ea9d9495e5
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
10 changed files with 148 additions and 131 deletions

View file

@ -28,13 +28,13 @@ in {
homeDirectory = homeDir; homeDirectory = homeDir;
stateVersion = const.stateVersion; stateVersion = const.stateVersion;
file = { file = {
".config/btop/btop.conf".text = btop.config; ".config/btop/btop.conf".text = btop.text;
".config/foot/foot.ini".text = foot.config; ".config/foot/foot.ini".text = foot.text;
".config/gtk-3.0/bookmarks".text = gtk3.bookmarks; ".config/gtk-3.0/bookmarks".text = gtk3.bookmarks;
".config/htop/htoprc".text = htop.config; ".config/htop/htoprc".text = htop.text;
".config/keyd/app.conf".text = keyd.config; ".config/keyd/app.conf".text = keyd.text;
".config/mako/config".text = mako.config; ".config/mako/config".text = mako.text;
".editorconfig".text = editorconfig.config; ".editorconfig".text = editorconfig.text;
".parallel/will-cite".text = ""; ".parallel/will-cite".text = "";
"media/template".source = ./template; "media/template".source = ./template;
}; };

View file

@ -1,25 +1,32 @@
{ util, ... }: { { lib, ... }: {
config = util.trimTabs '' text = lib.generators.toINIWithGlobalSection {} {
root = true globalSection.root = true;
[*] sections = {
end_of_line = lf "*" = {
charset = utf-8 end_of_line = "lf";
indent_style = tab charset = "utf-8";
indent_size = 2 indent_style = "tab";
insert_final_newline = true indent_size = "2";
trim_trailing_whitespace = true insert_final_newline = "true";
trim_trailing_whitespace = "true";
};
[Makefile] Makefile = {
indent_size = 2 indent_size = 2;
};
[*.{nix,js}] "*.{nix,js}" = {
indent_size = 2 indent_size = 2;
};
[*.{lua,kt,kts,rs,py}] "*.{lua,kt,kts,rs,py}" = {
indent_size = 4 indent_size = 4;
};
[*.{sh,md}] "*.{sh,md}" = {
indent_size = 8 indent_size = 8;
''; };
};
};
} }

View file

@ -1,17 +1,22 @@
{ style, setting, util, ... }: let { style, setting, lib, ... }: let
dpiaware = if setting.foot.font.dpi then "yes" else "no"; dpiaware = if setting.foot.font.dpi then "yes" else "no";
in { in {
config = util.trimTabs '' text = lib.generators.toINIWithGlobalSection {} {
font=${style.font.monospace.name}:size=${toString(style.font.size.terminal)} globalSection = {
# font-bold=${style.font.monospace.name}:size=${toString(style.font.size.terminal)} font = "${style.font.monospace.name}:size=${toString(style.font.size.terminal)}";
font-italic=${style.font.monospace.name}:size=${toString(style.font.size.terminal)} # font-bold = "${style.font.monospace.name}:size=${toString(style.font.size.terminal)}";
font-bold-italic=${style.font.monospace.name}:size=${toString(style.font.size.terminal)} font-italic = "${style.font.monospace.name}:size=${toString(style.font.size.terminal)}";
dpi-aware=${dpiaware} font-bold-italic = "${style.font.monospace.name}:size=${toString(style.font.size.terminal)}";
font-size-adjustment=${toString(setting.foot.font.step)} dpi-aware = dpiaware;
font-size-adjustment = setting.foot.font.step;
};
[colors] sections = {
alpha=${toString(style.opacity.terminal)} colors = {
background=${style.color.bg.dark} alpha = style.opacity.terminal;
foreground=${style.color.fg.light} background = style.color.bg.dark;
''; foreground = style.color.fg.light;
};
};
};
} }

View file

@ -1,3 +1,3 @@
{ util, setting, ... } @args: { { util, ... } @args: {
config = util.catText (util.ls ./module) args; text = util.catText (util.ls ./module) args;
} }

View file

@ -1,31 +1,32 @@
{ setting, ... }: { { setting, lib, ... }: {
text = '' text = lib.generators.toINI {} {
[steam-app-548430] steam-app-548430 = {
leftshift = timeout(leftcontrol, ${toString(setting.keyd.timeout.ms)}, leftshift) "alt.1" = "macro(enter 10ms L e t ' s space d o space t h i s space T e x a s space s t y l e ! enter)";
alt.w = macro(enter 10ms r enter) "alt.2" = "macro(enter 10ms H e c k space y e s ! enter)";
alt.a = macro(enter 10ms N o enter) "alt.3" = "macro(enter 10ms J u s t space a space s i d e - j o b space w h i l e 10ms space w a i t i n g space f o r space a space s e x space u p d a t e . enter)";
alt.s = macro(enter 10ms W a i t enter) "alt.4" = "macro(enter 10ms < 3 enter)";
alt.d = macro(enter 10ms Y e s enter) "alt.[" = "macro(enter 10ms W h a t space i s space c r u n c h y 10ms space o n space t h e space o u t s i d e , 10ms space g o o e y space o n space 10ms t h e space i n s i d e ? enter)";
alt.q = macro(enter 10ms S o r r y ! enter) "alt.]" = "macro(enter 10ms Q ' r o n a r space S h e l l b a c k ! enter)";
alt.e = macro(enter 10ms T h a n k s ! enter) "alt.a" = "macro(enter 10ms N o enter)";
alt.g = macro(enter 10ms g g enter) "alt.b" = "macro(enter 10ms I ' m space b a c k enter)";
alt.z = macro(enter 10ms < space L e f t enter) "alt.c" = "macro(enter 10ms > space R i g h t enter)";
alt.x = macro(enter 10ms > space H e r e space < enter) "alt.d" = "macro(enter 10ms Y e s enter)";
alt.c = macro(enter 10ms > space R i g h t enter) "alt.e" = "macro(enter 10ms T h a n k s ! enter)";
alt.r = macro(enter 10ms N e e d space m o r e space a m m o enter) "alt.f" = "macro(enter 10ms I space n e e d space h e l p ! enter)";
alt.t = macro(enter 10ms M a y space I space t a k e space e x t r a ? enter) "alt.g" = "macro(enter 10ms g g enter)";
alt.v = macro(enter 10ms A F K enter) "alt.j" = "macro(enter 10ms G o o d space j o b enter)";
alt.f = macro(enter 10ms I space n e e d space h e l p ! enter) "alt.k" = "macro(enter 10ms O k a y enter)";
alt.b = macro(enter 10ms I ' m space b a c k enter) "alt.l" = "macro(enter 10ms L e a f space l o v e r enter)";
alt.l = macro(enter 10ms L e a f space l o v e r enter) "alt.m" = "macro(enter 10ms I space r e p l y space u s i n g space m a c r o s . 10ms space U s e space s o f t w a r e space l i k e space k e y d , 10ms space o r space b u y space a space Q M K space k e y b o a r d . enter)";
alt.j = macro(enter 10ms G o o d space j o b enter) "alt.q" = "macro(enter 10ms S o r r y ! enter)";
alt.k = macro(enter 10ms O k a y enter) "alt.r" = "macro(enter 10ms N e e d space m o r e space a m m o enter)";
alt.1 = macro(enter 10ms L e t ' s space d o space t h i s space T e x a s space s t y l e ! enter) "alt.s" = "macro(enter 10ms W a i t enter)";
alt.2 = macro(enter 10ms H e c k space y e s ! enter) "alt.t" = "macro(enter 10ms M a y space I space t a k e space e x t r a ? enter)";
alt.3 = macro(enter 10ms J u s t space a space s i d e - j o b space w h i l e 10ms space w a i t i n g space f o r space a space s e x space u p d a t e . enter) "alt.v" = "macro(enter 10ms A F K enter)";
alt.4 = macro(enter 10ms < 3 enter) "alt.w" = "macro(enter 10ms r enter)";
alt.[ = macro(enter 10ms W h a t space i s space c r u n c h y 10ms space o n space t h e space o u t s i d e , 10ms space g o o e y space o n space 10ms t h e space i n s i d e ? enter) "alt.x" = "macro(enter 10ms > space H e r e space < enter)";
alt.] = macro(enter 10ms Q ' r o n a r space S h e l l b a c k ! enter) "alt.z" = "macro(enter 10ms < space L e f t enter)";
alt.m = macro(enter 10ms I space r e p l y space u s i n g space m a c r o s . 10ms space U s e space s o f t w a r e space l i k e space k e y d , 10ms space o r space b u y space a space Q M K space k e y b o a r d . enter) leftshift = "timeout(leftcontrol, ${toString(setting.keyd.timeout.ms)}, leftshift)";
''; };
};
} }

View file

@ -1,23 +1,24 @@
{ ... }: { { lib, ... }: {
text = '' text = lib.generators.toINI {} {
[firefox] "firefox" = {
alt.E = C-S-pagedown "alt.E" = "C-S-pagedown";
alt.N = S-f3 "alt.N" = "S-f3";
alt.Q = C-S-pageup "alt.Q" = "C-S-pageup";
alt.a = A-left "alt.a" = "A-left";
alt.d = A-right "alt.capslock" = "C-t";
alt.e = C-pagedown "alt.d" = "A-right";
alt.capslock = C-t "alt.e" = "C-pagedown";
alt.f = C-f "alt.f" = "C-f";
alt.l = A-S-a "alt.l" = "A-S-a";
alt.n = f3 "alt.n" = "f3";
alt.p = C-S-l "alt.p" = "C-S-l";
alt.q = C-pageup "alt.q" = "C-pageup";
alt.r = C-f5 "alt.r" = "C-f5";
alt.s = down "alt.s" = "down";
alt.space = f6 "alt.space" = "f6";
alt.u = C-S-t "alt.u" = "C-S-t";
alt.w = up "alt.w" = "up";
alt.x = C-w "alt.x" = "C-w";
''; };
};
} }

View file

@ -1,25 +1,26 @@
{ setting, ... }: { { setting, lib, ... }: {
text = '' text = lib.generators.toINI {} {
[jetbrains-*] "jetbrains-*" = {
alt.a = C-A-5 "alt./" = "C-/";
alt.c = S-escape "alt.=" = "C-A-l";
alt.d = S-f9 "alt.a" = "C-A-5";
alt.e = A-right "alt.c" = "S-escape";
alt.f = C-S-f "alt.capslock" = "C-A-S-insert";
alt.g = macro(gd) "alt.d" = "S-f9";
alt.i = C-i "alt.e" = "A-right";
alt.o = C-o "alt.f" = "C-S-f";
alt.q = A-left "alt.g" = "macro(gd)";
alt.n = C-A-n "alt.i" = "C-i";
alt.r = S-f10 "alt.n" = "C-A-n";
alt.s = C-A-s "alt.o" = "C-o";
alt.v = C-q "alt.q" = "A-left";
alt.w = C-S-A-t "alt.r" = "S-f10";
alt.x = C-f4 "alt.s" = "C-A-s";
alt.z = C-f2 "alt.tab" = "timeout(f8, ${toString(setting.keyd.timeout.ms)}, macro2(0, 0, f7))";
alt./ = C-/ "alt.v" = "C-q";
alt.= = C-A-l "alt.w" = "C-S-A-t";
alt.tab = timeout(f8, ${toString(setting.keyd.timeout.ms)}, macro2(0, 0, f7)) "alt.x" = "C-f4";
alt.capslock = C-A-S-insert "alt.z" = "C-f2";
''; };
};
} }

View file

@ -1,16 +1,18 @@
{ style, util, setting, ... }: let { style, lib, setting, ... }: let
alpha = style.opacity.hex; alpha = style.opacity.hex;
in { in {
config = util.trimTabs '' text = lib.generators.toINIWithGlobalSection {} {
anchor=top-center globalSection = {
default-timeout=${toString(setting.popup.timeout.ms)} anchor = "top-center";
font=${style.font.serif.name} ${toString(style.font.size.popup)} background-color = "#${style.color.bg.dark}${alpha}";
background-color=#${style.color.bg.dark}${alpha} border-color = "#${style.color.bg.regular}${alpha}";
border-color=#${style.color.bg.regular}${alpha} default-timeout = setting.popup.timeout.ms;
text-color=#${style.color.fg.light} font = "${style.font.serif.name} ${toString(style.font.size.popup)}";
height=120 height = 120;
icons=0 icons = 0;
margin=32 margin = 32;
width=480 text-color = "#${style.color.fg.light}";
''; width = 480;
};
};
} }

View file

@ -1,5 +1,5 @@
{ setting, util, ... }: { { setting, util, ... }: {
config = util.trimTabs '' text = util.trimTabs ''
#? Config file for btop v. 1.3.0 #? Config file for btop v. 1.3.0
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.

View file

@ -1,5 +1,5 @@
{ util, ... }: { { util, ... }: {
config = util.trimTabs '' text = util.trimTabs ''
# Beware! This file is rewritten by htop when settings are changed in the interface. # Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly. # The parser is also very primitive, and not human-friendly.
htop_version=3.2.2 htop_version=3.2.2