From c046518e5bc422ff50ec0dd1dfafe3948ed4ff18 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Wed, 27 Oct 2021 12:12:11 +0200 Subject: [PATCH] Moved configurations to templates --- configs/editorconfig | 15 ---------- configs/terminator/config | 40 -------------------------- modules/configurations.nix | 25 ++++++++++------ modules/terminator.nix | 59 +++++++++++++++++++++++++++++++++++--- 4 files changed, 72 insertions(+), 67 deletions(-) delete mode 100644 configs/editorconfig delete mode 100644 configs/terminator/config diff --git a/configs/editorconfig b/configs/editorconfig deleted file mode 100644 index 794c2d4..0000000 --- a/configs/editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -# editorconfig.org - -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 2 -# max_line_length = 120 -indent_style = space -trim_trailing_whitespace = true -insert_final_newline = true - -[*.py] -indent_size = 4 diff --git a/configs/terminator/config b/configs/terminator/config deleted file mode 100644 index 4acdefb..0000000 --- a/configs/terminator/config +++ /dev/null @@ -1,40 +0,0 @@ -[global_config] - scroll_tabbar = True - enabled_plugins = ActivityWatch, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler - suppress_multiple_term_dialog = True - always_split_with_profile = True -[keybindings] - help = None -[profiles] - [[default]] - visible_bell = True - background_color = "#2e3440" - background_darkness = 0.95 - background_type = transparent - cursor_color = "#d8dee9" - font = FuraCode Nerd Font Mono weight=450 9 - foreground_color = "#d8dee9" - show_titlebar = False - scrollbar_position = hidden - scrollback_lines = 10000 - palette = "#3b4252:#bf616a:#a3be8c:#ebcb8b:#81a1c1:#b48ead:#88c0d0:#e5e9f0:#4c566a:#bf616a:#a3be8c:#ebcb8b:#81a1c1:#b48ead:#8fbcbb:#eceff4" - use_system_font = False - [[presentation]] - visible_bell = True - background_color = "#fdf6e3" - cursor_color = "#aaaaaa" - font = FuraCode Nerd Font Mono weight=450 20 - foreground_color = "#2e3436" - show_titlebar = False - palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3" - use_system_font = False -[layouts] - [[default]] - [[[child1]]] - parent = window0 - type = Terminal - profile = default - [[[window0]]] - parent = "" - type = Window -[plugins] diff --git a/modules/configurations.nix b/modules/configurations.nix index 7eef999..bc9d930 100644 --- a/modules/configurations.nix +++ b/modules/configurations.nix @@ -1,10 +1,19 @@ { - home.file.".editorconfig" = { - source = ../configs/editorconfig; - target = ".editorconfig"; - }; - # home.file.".XCompose" = { - # source = ../configs/xcompose; - # target = ".XCompose"; - # }; + home.file.".editorconfig".text = '' + # editorconfig.org + + root = true + + [*] + charset = utf-8 + end_of_line = lf + indent_size = 2 + # max_line_length = 120 + indent_style = space + trim_trailing_whitespace = true + insert_final_newline = true + + [*.py] + indent_size = 4 + ''; } diff --git a/modules/terminator.nix b/modules/terminator.nix index 4e5d540..b9bbb6c 100644 --- a/modules/terminator.nix +++ b/modules/terminator.nix @@ -1,8 +1,59 @@ { pkgs, ... }: +let + strPalette = with pkgs.rice; palette.toRgbHex rec { + inherit (colorPalette) normal bright dark; + background = normal.black; + foreground = normal.white; + }; + opacity = toString pkgs.rice.opacity; + font = pkgs.rice.font.monospace; + colorString = with strPalette; normal: bright: builtins.concatStringsSep ":" [ normal.black normal.red normal.green normal.yellow normal.blue normal.magenta normal.cyan normal.white bright.black bright.red bright.green bright.yellow bright.blue bright.magenta bright.cyan bright.white ]; +in { - home.packages = with pkgs; [ - terminator - ]; + home.packages = with pkgs; [ + terminator + ]; - xdg.configFile."terminator/config".source = ../configs/terminator/config; + xdg.configFile."terminator/config".text = with strPalette; '' + [global_config] + scroll_tabbar = True + enabled_plugins = ActivityWatch, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler + suppress_multiple_term_dialog = True + always_split_with_profile = True + [keybindings] + help = None + [profiles] + [[default]] + visible_bell = True + background_color = "${background}" + background_darkness = ${opacity} + background_type = transparent + cursor_color = "${foreground}" + font = ${font.name} weight=450 ${toString font.size} + foreground_color = "${foreground}" + show_titlebar = False + scrollbar_position = hidden + scrollback_lines = 10000 + palette = "${colorString normal bright}" + use_system_font = False + [[presentation]] + visible_bell = True + background_color = "${background}" + cursor_color = "${foreground}" + font = ${font.name} weight=450 20 + foreground_color = "${foreground}" + show_titlebar = False + palette = "${colorString normal bright}" + use_system_font = False + [layouts] + [[default]] + [[[child1]]] + parent = window0 + type = Terminal + profile = default + [[[window0]]] + parent = "" + type = Window + [plugins] + ''; }