From d5c424e238f5c8b382261e31d7fe56b66f819ae2 Mon Sep 17 00:00:00 2001 From: Sean Kovacs Date: Thu, 5 Mar 2026 21:41:12 -0500 Subject: [PATCH] terminal refactor, move packages to default, inline btop theme --- home/terminal/btop.nix | 178 +++++++++++++++++++------------------- home/terminal/default.nix | 39 +++++++-- home/terminal/fish.nix | 7 -- home/terminal/kitty.nix | 9 -- home/terminal/neovim.nix | 10 --- 5 files changed, 119 insertions(+), 124 deletions(-) diff --git a/home/terminal/btop.nix b/home/terminal/btop.nix index 64d5fe1..b8db438 100644 --- a/home/terminal/btop.nix +++ b/home/terminal/btop.nix @@ -4,107 +4,105 @@ ... }: let - btop-colors = with config.scheme.withHashtag; '' - # Credit to https://github.com/catppuccin/btop - # Main background, empty for terminal default, need to be empty if you want transparent background - theme[main_bg]="${base00}" - - # Main text color - theme[main_fg]="${base05}" - - # Title color for boxes - theme[title]="${base05}" - - # Highlight color for keyboard shortcuts - theme[hi_fg]="${base0D}" - - # Background color of selected item in processes box - theme[selected_bg]="${base02}" - - # Foreground color of selected item in processes box - theme[selected_fg]="${base0D}" - - # Color of inactive/disabled text - theme[inactive_fg]="${base03}" - - # Color of text appearing on top of graphs, i.e uptime and current network graph scaling - theme[graph_text]="${base06}" - - # Background color of the percentage meters - theme[meter_bg]="${base02}" - - # Misc colors for processes box including mini cpu graphs, details memory graph and details status text - theme[proc_misc]="${base06}" - - # CPU, Memory, Network, Proc box outline colors - theme[cpu_box]="${base0E}" #Mauve - theme[mem_box]="${base0B}" #Green - theme[net_box]="${base12}" #Maroon - theme[proc_box]="${base0D}" #Blue - - # Box divider line and small boxes line color - theme[div_line]="${base03}" - - # Temperature graph color (Green -> Yellow -> Red) - theme[temp_start]="${base0B}" - theme[temp_mid]="${base0A}" - theme[temp_end]="${base08}" - - # CPU graph colors (Teal -> Lavender) - theme[cpu_start]="${base0C}" - theme[cpu_mid]="${base16}" - theme[cpu_end]="${base07}" - - # Mem/Disk free meter (Mauve -> Lavender -> Blue) - theme[free_start]="${base0E}" - theme[free_mid]="${base07}" - theme[free_end]="${base0D}" - - # Mem/Disk cached meter (Sapphire -> Lavender) - theme[cached_start]="${base16}" - theme[cached_mid]="${base0D}" - theme[cached_end]="${base07}" - - # Mem/Disk available meter (Peach -> Red) - theme[available_start]="${base09}" - theme[available_mid]="${base12}" - theme[available_end]="${base08}" - - # Mem/Disk used meter (Green -> Sky) - theme[used_start]="${base0B}" - theme[used_mid]="${base0C}" - theme[used_end]="${base15}" - - # Download graph colors (Peach -> Red) - theme[download_start]="${base09}" - theme[download_mid]="${base12}" - theme[download_end]="${base08}" - - # Upload graph colors (Green -> Sky) - theme[upload_start]="${base0B}" - theme[upload_mid]="${base0C}" - theme[upload_end]="${base15}" - - # Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve) - theme[process_start]="${base16}" - theme[process_mid]="${base07}" - theme[process_end]="${base0E}" - ''; - btop-colors-file = pkgs.writeTextFile { name = "btop-colors"; - text = btop-colors; + text = with config.scheme.withHashtag; '' + # Credit to https://github.com/catppuccin/btop + # Main background, empty for terminal default, need to be empty if you want transparent background + theme[main_bg]="${base00}" + + # Main text color + theme[main_fg]="${base05}" + + # Title color for boxes + theme[title]="${base05}" + + # Highlight color for keyboard shortcuts + theme[hi_fg]="${base0D}" + + # Background color of selected item in processes box + theme[selected_bg]="${base02}" + + # Foreground color of selected item in processes box + theme[selected_fg]="${base0D}" + + # Color of inactive/disabled text + theme[inactive_fg]="${base03}" + + # Color of text appearing on top of graphs, i.e uptime and current network graph scaling + theme[graph_text]="${base06}" + + # Background color of the percentage meters + theme[meter_bg]="${base02}" + + # Misc colors for processes box including mini cpu graphs, details memory graph and details status text + theme[proc_misc]="${base06}" + + # CPU, Memory, Network, Proc box outline colors + theme[cpu_box]="${base0E}" #Mauve + theme[mem_box]="${base0B}" #Green + theme[net_box]="${base12}" #Maroon + theme[proc_box]="${base0D}" #Blue + + # Box divider line and small boxes line color + theme[div_line]="${base03}" + + # Temperature graph color (Green -> Yellow -> Red) + theme[temp_start]="${base0B}" + theme[temp_mid]="${base0A}" + theme[temp_end]="${base08}" + + # CPU graph colors (Teal -> Lavender) + theme[cpu_start]="${base0C}" + theme[cpu_mid]="${base16}" + theme[cpu_end]="${base07}" + + # Mem/Disk free meter (Mauve -> Lavender -> Blue) + theme[free_start]="${base0E}" + theme[free_mid]="${base07}" + theme[free_end]="${base0D}" + + # Mem/Disk cached meter (Sapphire -> Lavender) + theme[cached_start]="${base16}" + theme[cached_mid]="${base0D}" + theme[cached_end]="${base07}" + + # Mem/Disk available meter (Peach -> Red) + theme[available_start]="${base09}" + theme[available_mid]="${base12}" + theme[available_end]="${base08}" + + # Mem/Disk used meter (Green -> Sky) + theme[used_start]="${base0B}" + theme[used_mid]="${base0C}" + theme[used_end]="${base15}" + + # Download graph colors (Peach -> Red) + theme[download_start]="${base09}" + theme[download_mid]="${base12}" + theme[download_end]="${base08}" + + # Upload graph colors (Green -> Sky) + theme[upload_start]="${base0B}" + theme[upload_mid]="${base0C}" + theme[upload_end]="${base15}" + + # Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve) + theme[process_start]="${base16}" + theme[process_mid]="${base07}" + theme[process_end]="${base0E}" + ''; destination = "/nixos.theme"; }; - mergedConfig = pkgs.runCommand "mergedConfig" { } '' + batConfigDir = pkgs.runCommand "mergedConfig" { } '' mkdir -p $out/themes cp -r ${btop-colors-file}/nixos.theme $out/themes/nixos.theme ''; in { home.file.".config/btop" = { - source = mergedConfig; + source = batConfigDir; recursive = true; }; } diff --git a/home/terminal/default.nix b/home/terminal/default.nix index 4210b84..e87624e 100644 --- a/home/terminal/default.nix +++ b/home/terminal/default.nix @@ -28,6 +28,9 @@ browsh mosh gh + kdePackages.qttools + eza + pigz # development & tooling jdk21_headless @@ -42,17 +45,37 @@ flaresolverr nerd-fonts.fira-mono ffmpeg-full + + # formatters + kdePackages.qtdeclarative + prettier + prettierd + nixfmt + stylua + black + clang-tools ]; - programs.git = { - enable = true; - settings = { - user = { - name = config.userOptions.name; - email = config.userOptions.email; + programs = { + git = { + enable = true; + settings = { + user = { + name = config.userOptions.name; + email = config.userOptions.email; + }; + core.pager = "${pkgs.bat}/bin/bat"; + commit.gpgsign = true; }; - core.pager = "${pkgs.bat}/bin/bat"; - commit.gpgsign = true; }; + bat = { + enable = true; + config.style = "numbers,changes"; + }; + lazygit = { + enable = true; + enableFishIntegration = true; + }; + lazysql.enable = true; }; } diff --git a/home/terminal/fish.nix b/home/terminal/fish.nix index ca784f0..494b516 100644 --- a/home/terminal/fish.nix +++ b/home/terminal/fish.nix @@ -1,16 +1,9 @@ { - pkgs, config, lib, ... }: { - home.packages = with pkgs; [ - kdePackages.qttools - eza - pigz - ]; - programs.fish = { enable = true; shellAliases = { diff --git a/home/terminal/kitty.nix b/home/terminal/kitty.nix index b6525dc..5cea79a 100644 --- a/home/terminal/kitty.nix +++ b/home/terminal/kitty.nix @@ -128,14 +128,5 @@ in macos_titlebar_color = "system"; }; }; - bat = { - enable = true; - # config.theme = "Catppuccin ${config.catppuccinUpper.flavor}"; - }; - lazygit = { - enable = true; - enableFishIntegration = true; - }; - lazysql.enable = true; }; } diff --git a/home/terminal/neovim.nix b/home/terminal/neovim.nix index f45e453..beda1d1 100644 --- a/home/terminal/neovim.nix +++ b/home/terminal/neovim.nix @@ -7,16 +7,6 @@ { home.sessionVariables.EDITOR = lib.mkForce "kitty nvim"; - home.packages = with pkgs; [ - kdePackages.qtdeclarative - prettier - prettierd - nixfmt - stylua - black - clang-tools - ]; - programs.nixvim = { enable = true; enablePrintInit = true;