diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-03-31 21:29:27 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-03-31 21:29:27 +0300 |
commit | 9a5427e3a0c0ccf2a82dc503149a26b23fbd6004 (patch) | |
tree | f28beec29deeea36038615a8fb98a810891940b5 /modules/common/profiles/dev/sql.nix | |
parent | 2024-03-19 (diff) |
2024-03-31
Diffstat (limited to '')
-rw-r--r-- | modules/common/profiles/dev/sql.nix | 151 |
1 files changed, 78 insertions, 73 deletions
diff --git a/modules/common/profiles/dev/sql.nix b/modules/common/profiles/dev/sql.nix index 3e1c4b2..c2d4894 100644 --- a/modules/common/profiles/dev/sql.nix +++ b/modules/common/profiles/dev/sql.nix @@ -4,9 +4,11 @@ pkgs, ... }: -with lib; let +with lib; +let cfg = config.nixfiles.modules.profiles.dev.sql; -in { +in +{ options.nixfiles.modules.profiles.dev.sql.enable = mkEnableOption "SQL stuff and database management tools" // { @@ -20,81 +22,84 @@ in { litecli ]; - xdg = let - mainSection = { - destructive_warning = "True"; - enable_pager = "True"; - keyword_casing = "auto"; - less_chatty = "True"; - log_file = "/dev/null"; - log_level = "CRITICAL"; - multi_line = "False"; - syntax_style = "default"; - table_format = "fancy_grid"; - }; + xdg = + let + mainSection = { + destructive_warning = "True"; + enable_pager = "True"; + keyword_casing = "auto"; + less_chatty = "True"; + log_file = "/dev/null"; + log_level = "CRITICAL"; + multi_line = "False"; + syntax_style = "default"; + table_format = "fancy_grid"; + }; - colorsSection = with config.colors.withHashtag; { - "arg-toolbar" = "noinherit bold"; - "arg-toolbar.text" = "nobold"; - "bottom-toolbar" = "bg:${base01} ${base06}"; - "bottom-toolbar.off" = "bg:${base01} ${base02}"; - "bottom-toolbar.on" = "bg:${base01} ${base07}"; - "bottom-toolbar.transaction.failed" = "bg:${base01} ${base08} bold"; - "bottom-toolbar.transaction.valid" = "bg:${base01} ${base0B} bold"; - "completion-menu.completion" = "bg:${base01} ${base06}"; - "completion-menu.completion.current" = "bg:${base06} ${base01}"; - "completion-menu.meta.completion" = "bg:${base01} ${base13}"; - "completion-menu.meta.completion.current" = "bg:${base09} ${base01}"; - "completion-menu.multi-column-meta" = "bg:${base09} ${base01}"; - "scrollbar" = "bg:${base01}"; - "scrollbar.arrow" = "bg:${base01}"; - "search" = "bg:${base17} ${base07}"; - "search-toolbar" = "noinherit bold"; - "search-toolbar.text" = "nobold"; - "search.current" = "bg:${base14} ${base07}"; - "selected" = "bg:${base0D} ${base07}"; - "system-toolbar" = "noinherit bold"; - }; + colorsSection = with config.colors.withHashtag; { + "arg-toolbar" = "noinherit bold"; + "arg-toolbar.text" = "nobold"; + "bottom-toolbar" = "bg:${base01} ${base06}"; + "bottom-toolbar.off" = "bg:${base01} ${base02}"; + "bottom-toolbar.on" = "bg:${base01} ${base07}"; + "bottom-toolbar.transaction.failed" = "bg:${base01} ${base08} bold"; + "bottom-toolbar.transaction.valid" = "bg:${base01} ${base0B} bold"; + "completion-menu.completion" = "bg:${base01} ${base06}"; + "completion-menu.completion.current" = "bg:${base06} ${base01}"; + "completion-menu.meta.completion" = "bg:${base01} ${base13}"; + "completion-menu.meta.completion.current" = "bg:${base09} ${base01}"; + "completion-menu.multi-column-meta" = "bg:${base09} ${base01}"; + "scrollbar" = "bg:${base01}"; + "scrollbar.arrow" = "bg:${base01}"; + "search" = "bg:${base17} ${base07}"; + "search-toolbar" = "noinherit bold"; + "search-toolbar.text" = "nobold"; + "search.current" = "bg:${base14} ${base07}"; + "selected" = "bg:${base0D} ${base07}"; + "system-toolbar" = "noinherit bold"; + }; - mkCliConfig = { - name, - custom, - }: { - "${name}/config" = { - text = generators.toINI {} { - main = mainSection // custom; - colors = mapAttrs (_: v: "'${v}'") colorsSection; + mkCliConfig = + { name, custom }: + { + "${name}/config" = { + text = generators.toINI { } { + main = mainSection // custom; + colors = mapAttrs (_: v: "'${v}'") colorsSection; + }; + }; }; - }; + in + { + configFile = mkMerge ( + map mkCliConfig [ + { + name = "pgcli"; + custom = { + prompt = "'\\u@\\h:\\d> '"; + multi_line_mode = "psql"; + on_error = "STOP"; + auto_expand = "True"; + expand = "True"; + keyring = "False"; + vi = "True"; + casing_file = "/dev/null"; + history_file = "/dev/null"; + }; + } + { + name = "litecli"; + custom = { + prompt = "'\\d> '"; + prompt_continuation = "'-> '"; + auto_vertical_output = "True"; + key_bindings = "vi"; + audit_log = "/dev/null"; + }; + } + ] + ); }; - in { - configFile = mkMerge (map mkCliConfig [ - { - name = "pgcli"; - custom = { - prompt = "'\\u@\\h:\\d> '"; - multi_line_mode = "psql"; - on_error = "STOP"; - auto_expand = "True"; - expand = "True"; - keyring = "False"; - vi = "True"; - casing_file = "/dev/null"; - history_file = "/dev/null"; - }; - } - { - name = "litecli"; - custom = { - prompt = "'\\d> '"; - prompt_continuation = "'-> '"; - auto_vertical_output = "True"; - key_bindings = "vi"; - audit_log = "/dev/null"; - }; - } - ]); - }; }; }; } |