fix cli tools config

This commit is contained in:
Chris Kruining 2025-03-28 22:07:09 +01:00
parent 555068556f
commit 816b85e06e
Signed by: chris
SSH key fingerprint: SHA256:nG82MUfuVdRVyCKKWqhY+pCrbz9nbX6uzUns4RKa1Pg
9 changed files with 393 additions and 353 deletions

View file

@ -34,12 +34,13 @@ in
yazi.enable = true;
eza.enable = true;
git.enable = true;
zoxide.enable = true;
};
home-manager.users.${user} = {
home.packages = attrValues {
inherit (pkgs) any-nix-shell pwgen yt-dlp ripdrag yazi;
inherit (pkgs) bat fd zoxide;
inherit (pkgs) any-nix-shell pwgen yt-dlp ripdrag;
inherit (pkgs) fd;
rgFull = pkgs.ripgrep.override {withPCRE2 = true;};
};
@ -62,11 +63,6 @@ in
nix-direnv.enable = true;
config.whitelist.prefix = ["/home"];
};
bat.enable = true;
eza.enable = true;
fzf.enable = true;
zoxide.enable = true;
};
};
})

View file

@ -1,91 +1,94 @@
{ config, options, lib, pkgs, user, ... }:
{ config, lib, pkgs, user, ... }:
let
inherit (lib.modules) mkIf;
inherit (lib) mkIf mkEnableOption;
inherit (lib.strings) concatStringsSep;
cfg = config.modules.${user}.shell.toolset.btop;
in
{
options.modules.${user}.shell.toolset.btop = let
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "system-monitor"; };
options.modules.${user}.shell.toolset.btop = {
enable = mkEnableOption "system-monitor";
};
config = mkIf config.modules.${user}.shell.toolset.btop.enable {
home-manager.users.${user}.programs.btop = let
inherit (config.modules.themes) active;
in
{
enable = true;
settings = {
force_tty = false;
vim_keys = true; # Directional keys: "h,j,k,l,g,G"
update_ms = 1500; # ms (s^{-3})
temp_scale = "celsius";
base_10_sizes = false;
show_cpu_freq = true;
clock_format = "%H:%M";
background_update = true;
disks_filter = "exclude=/boot";
config = mkIf cfg.enable {
home-manager.users.${user} = {
packages = with pkgs; [ btop ];
rounded_corners = true;
theme_background = false;
truecolor = true;
presets = concatStringsSep "," [
"cpu:1:default"
"proc:0:default cpu:0:default"
"mem:0:default"
"net:0:default cpu:0:block"
"net:0:tty"
];
graph_symbol = "braille";
graph_symbol_cpu = "default";
graph_symbol_mem = "default";
graph_symbol_net = "default";
graph_symbol_proc = "default";
shown_boxes = "proc cpu mem net";
programs.btop = {
enable = true;
settings = {
force_tty = false;
vim_keys = true; # Directional keys: "h,j,k,l,g,G"
update_ms = 1500; # ms (s^{-3})
temp_scale = "celsius";
base_10_sizes = false;
show_cpu_freq = true;
clock_format = "%H:%M";
background_update = true;
disks_filter = "exclude=/boot";
proc_sorting = "cpu lazy";
proc_reversed = false;
proc_tree = false;
proc_colors = true;
proc_gradient = true;
proc_per_core = true;
proc_mem_bytes = true;
proc_info_smaps = false;
proc_left = false;
rounded_corners = true;
theme_background = false;
truecolor = true;
presets = concatStringsSep "," [
"cpu:1:default"
"proc:0:default cpu:0:default"
"mem:0:default"
"net:0:default cpu:0:block"
"net:0:tty"
];
graph_symbol = "braille";
graph_symbol_cpu = "default";
graph_symbol_mem = "default";
graph_symbol_net = "default";
graph_symbol_proc = "default";
shown_boxes = "proc cpu mem net";
cpu_graph_upper = "total";
cpu_graph_lower = "total";
cpu_single_graph = false;
cpu_bottom = false;
show_uptime = true;
check_temp = true;
cpu_sensor = "Auto";
show_coretemp = true;
cpu_core_map = "";
custom_cpu_name = "";
proc_sorting = "cpu lazy";
proc_reversed = false;
proc_tree = false;
proc_colors = true;
proc_gradient = true;
proc_per_core = true;
proc_mem_bytes = true;
proc_info_smaps = false;
proc_left = false;
mem_graphs = true;
mem_below_net = false;
cpu_graph_upper = "total";
cpu_graph_lower = "total";
cpu_single_graph = false;
cpu_bottom = false;
show_uptime = true;
check_temp = true;
cpu_sensor = "Auto";
show_coretemp = true;
cpu_core_map = "";
custom_cpu_name = "";
show_swap = true;
swap_disk = true;
show_disks = true;
only_physical = true;
use_fstab = false; # Enable -> disables `only_physical`
disk_free_priv = false;
show_io_stat = true;
mem_graphs = true;
mem_below_net = false;
io_mode = false;
io_graph_combined = false;
io_graph_speeds = "";
show_swap = true;
swap_disk = true;
show_disks = true;
only_physical = true;
use_fstab = false; # Enable -> disables `only_physical`
disk_free_priv = false;
show_io_stat = true;
net_download = 100;
net_upload = 100;
net_auto = true;
net_sync = false;
net_iface = "br0";
show_battery = true;
selected_battery = "Auto";
log_level = "DEBUG";
io_mode = false;
io_graph_combined = false;
io_graph_speeds = "";
net_download = 100;
net_upload = 100;
net_auto = true;
net_sync = false;
net_iface = "br0";
show_battery = true;
selected_battery = "Auto";
log_level = "DEBUG";
};
};
};
};

View file

@ -7,20 +7,24 @@ let
cfg = config.modules.${user}.shell.toolset.eza;
in
{
options.modules.${user}.shell.toolset.eza = {
enable = mkEnableOption "system-monitor";
options.modules.${user}.shell.toolset.eza = {
enable = mkEnableOption "system-monitor";
};
config = mkIf cfg.enable {
home-manager.users.${user}.programs.eza = {
enable = true;
icons = "auto";
git = true;
extraOptions = [
"--hyperlink"
"--across"
"--group-directories-first"
];
home-manager.users.${user} = {
packages = with pkgs; [ eza ];
programs.eza = {
enable = true;
icons = "auto";
git = true;
extraOptions = [
"--hyperlink"
"--across"
"--group-directories-first"
];
};
};
};
}

View file

@ -1,34 +1,37 @@
{ config, options, lib, pkgs, user, ... }:
let
inherit (lib.attrsets) optionalAttrs;
inherit (lib.modules) mkIf;
inherit (lib) mkIf mkEnableOption;
defShell = config.modules.${user}.shell.default;
in
{
options.modules.${user}.shell.toolset.fzf = let
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "TUI Fuzzy Finder."; };
options.modules.${user}.shell.toolset.fzf = {
enable = mkEnableOption "TUI Fuzzy Finder.";
};
config = mkIf config.modules.${user}.shell.toolset.fzf.enable {
home-manager.users.${user}.programs.fzf = let
defShell = config.modules.${user}.shell.default;
in {
enable = true;
enableBashIntegration = true;
enableZshIntegration = defShell == "zsh";
enableFishIntegration = defShell == "fish";
home-manager.users.${user} = {
packages = with pkgs; [ fzf ];
tmux.enableShellIntegration = true;
tmux.shellIntegrationOptions = ["-d 40%"];
programs.fzf = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = defShell == "zsh";
enableFishIntegration = defShell == "fish";
defaultCommand = "fd --type f";
defaultOptions = ["--height 40%" "--border"];
tmux.enableShellIntegration = true;
tmux.shellIntegrationOptions = ["-d 40%"];
changeDirWidgetCommand = "fd --type d";
changeDirWidgetOptions = ["--preview 'tree -C {} | head -200'"];
defaultCommand = "fd --type f";
defaultOptions = ["--height 40%" "--border"];
fileWidgetCommand = "fd --type f";
fileWidgetOptions = ["--preview 'head {}'"];
historyWidgetOptions = ["--sort" "--exact"];
changeDirWidgetCommand = "fd --type d";
changeDirWidgetOptions = ["--preview 'tree -C {} | head -200'"];
fileWidgetCommand = "fd --type f";
fileWidgetOptions = ["--preview 'head {}'"];
historyWidgetOptions = ["--sort" "--exact"];
};
};
};
}

View file

@ -14,103 +14,103 @@ in
home-manager.users.${user} = {
home.packages = attrValues {
inherit (pkgs) act dura lazygit;
inherit (pkgs) git act dura lazygit;
inherit (pkgs.gitAndTools) gh git-open git-crypt;
};
programs = {
zsh.initExtra = ''
# -------===[ Helpful Git Fn's ]===------- #
gitignore() {
curl -s -o .gitignore https://gitignore.io/api/$1
}
'';
zsh.initExtra = ''
# -------===[ Helpful Git Fn's ]===------- #
gitignore() {
curl -s -o .gitignore https://gitignore.io/api/$1
}
'';
fish.functions = {
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
};
fish.functions = {
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
};
git = {
enable = true;
package = pkgs.gitFull;
difftastic = {
git = {
enable = true;
background = "dark";
color = "always";
display = "inline";
};
ignores = [
# General:
"*.bloop"
"*.bsp"
"*.metals"
"*.metals.sbt"
"*metals.sbt"
"*.direnv"
"*.envrc"
"*hie.yaml"
"*.mill-version"
"*.jvmopts"
# OS-related:
".DS_Store?"
".DS_Store"
".CFUserTextEncoding"
".Trash"
".Xauthority"
"thumbs.db"
"Thumbs.db"
"Icon?"
# Compiled residues:
"*.class"
"*.exe"
"*.o"
"*.pyc"
"*.elc"
];
extraConfig = {
init.defaultBranch = "main";
core = {
editor = "nvim";
whitespace = "trailing-space,space-before-tab";
};
credential.helper = "${pkgs.gitFull}/bin/git-credential-libsecret";
user = {
name = config.modules.${user}.user.full_name;
email = config.modules.${user}.user.email;
signingKey = "~/.ssh/id_rsa.pub";
package = pkgs.gitFull;
difftastic = {
enable = true;
background = "dark";
color = "always";
display = "inline";
};
gpg.format = "ssh";
commit.gpgSign = true;
tag.gpgSign = true;
ignores = [
# General:
"*.bloop"
"*.bsp"
"*.metals"
"*.metals.sbt"
"*metals.sbt"
"*.direnv"
"*.envrc"
"*hie.yaml"
"*.mill-version"
"*.jvmopts"
push = {
autoSetupRemote = true;
default = "current";
gpgSign = "if-asked";
autoSquash = true;
};
pull.rebase = true;
# OS-related:
".DS_Store?"
".DS_Store"
".CFUserTextEncoding"
".Trash"
".Xauthority"
"thumbs.db"
"Thumbs.db"
"Icon?"
filter = {
required = true;
smudge = "git-lfs smudge -- %f";
process = "git-lfs filter-process";
clean = "git-lfs clean -- %f";
};
# Compiled residues:
"*.class"
"*.exe"
"*.o"
"*.pyc"
"*.elc"
];
url = {
"https://github.com/".insteadOf = "gh:";
"git@github.com:".insteadOf = "ssh+gh:";
extraConfig = {
init.defaultBranch = "main";
core = {
editor = "nvim";
whitespace = "trailing-space,space-before-tab";
};
credential.helper = "${pkgs.gitFull}/bin/git-credential-libsecret";
user = {
name = config.modules.${user}.user.full_name;
email = config.modules.${user}.user.email;
signingKey = "~/.ssh/id_rsa.pub";
};
gpg.format = "ssh";
commit.gpgSign = true;
tag.gpgSign = true;
push = {
autoSetupRemote = true;
default = "current";
gpgSign = "if-asked";
autoSquash = true;
};
pull.rebase = true;
filter = {
required = true;
smudge = "git-lfs smudge -- %f";
process = "git-lfs filter-process";
clean = "git-lfs clean -- %f";
};
url = {
"https://github.com/".insteadOf = "gh:";
"git@github.com:".insteadOf = "ssh+gh:";
};
};
};
};
};
};
};
}

View file

@ -1,4 +1,4 @@
{ config, lib, user, ... }:
{ config, lib, pkgs, user, ... }:
let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
@ -9,87 +9,91 @@ in
};
config = mkIf config.modules.${user}.shell.toolset.starship.enable {
home-manager.users.${user}.programs.starship = {
enable = true;
settings = {
format = "[](bold green) $username@$hostname$nix_shell: $directory$cmd_duration$git_branch$git_commit$git_state$git_status$line_break[](green bold)$character";
home-manager.users.${user} = {
packages = with pkgs; [ starship ];
username = {
format = "[$user]($style)";
show_always = true;
};
programs.starship = {
enable = true;
settings = {
format = "[](bold green) $username@$hostname$nix_shell: $directory$cmd_duration$git_branch$git_commit$git_state$git_status$line_break[](green bold)$character";
hostname = {
ssh_only = false;
ssh_symbol = "🌐 ";
format = "[$hostname](bold red)";
trim_at = ".local";
disabled = false;
};
nix_shell = {
symbol = " ";
format = "[$symbol$name]($style) ";
style = "magenta bold";
};
git_branch = {
only_attached = true;
format = "[$symbol$branch]($style) ";
symbol = " ";
style = "yellow bold";
};
git_commit = {
tag_disabled = false;
};
git_state = {
style = "magenta bold";
};
git_status = {
format = "[$all_status $ahead_behind]($style) ";
style = "bold green";
conflicted = "🏳";
up_to_date = "";
untracked = " ";
ahead = "\${count}";
diverged = "\${ahead_count}\${behind_count}";
behind = "\${count}";
stashed = " ";
modified = " ";
staged = "[++\($count\)](green)";
renamed = " ";
deleted = " ";
};
directory = {
read_only = " 󰌾";
};
cmd_duration = {
format = "[$duration]($style) ";
style = "blue";
};
os = {
format = "[$symbol](bold white)";
disabled = false;
symbols = {
Windows = " ";
Arch = "󰣇";
Ubuntu = "";
Macos = "󰀵";
Manjaro = " ";
Nobara = " ";
Unknown = "󰠥";
username = {
format = "[$user]($style)";
show_always = true;
};
};
fill = {
symbol = " ";
hostname = {
ssh_only = false;
ssh_symbol = "🌐 ";
format = "[$hostname](bold red)";
trim_at = ".local";
disabled = false;
};
nix_shell = {
symbol = " ";
format = "[$symbol$name]($style) ";
style = "magenta bold";
};
git_branch = {
only_attached = true;
format = "[$symbol$branch]($style) ";
symbol = " ";
style = "yellow bold";
};
git_commit = {
tag_disabled = false;
};
git_state = {
style = "magenta bold";
};
git_status = {
format = "[$all_status $ahead_behind]($style) ";
style = "bold green";
conflicted = "🏳";
up_to_date = "";
untracked = " ";
ahead = "\${count}";
diverged = "\${ahead_count}\${behind_count}";
behind = "\${count}";
stashed = " ";
modified = " ";
staged = "[++\($count\)](green)";
renamed = " ";
deleted = " ";
};
directory = {
read_only = " 󰌾";
};
cmd_duration = {
format = "[$duration]($style) ";
style = "blue";
};
os = {
format = "[$symbol](bold white)";
disabled = false;
symbols = {
Windows = " ";
Arch = "󰣇";
Ubuntu = "";
Macos = "󰀵";
Manjaro = " ";
Nobara = " ";
Unknown = "󰠥";
};
};
fill = {
symbol = " ";
};
};
};
};

View file

@ -8,96 +8,100 @@ in
in { enable = mkEnableOption "terminal multiplexer"; };
config = mkIf config.modules.${user}.shell.toolset.tmux.enable {
home-manager.users.${user}.programs.tmux = {
enable = true;
secureSocket = true;
keyMode = "vi";
prefix = "C-a";
terminal = "tmux-256color";
home-manager.users.${user} = {
packages = with pkgs; [ tmux ];
baseIndex = 1;
clock24 = true;
disableConfirmationPrompt = true;
escapeTime = 0;
programs.tmux = {
enable = true;
secureSocket = true;
keyMode = "vi";
prefix = "C-a";
terminal = "tmux-256color";
aggressiveResize = false;
resizeAmount = 2;
reverseSplit = false;
historyLimit = 5000;
newSession = true;
baseIndex = 1;
clock24 = true;
disableConfirmationPrompt = true;
escapeTime = 0;
plugins = let
inherit (pkgs.tmuxPlugins) resurrect continuum;
in [
{
plugin = resurrect;
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
}
{
plugin = continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-save-interval '60' # minutes
'';
}
];
aggressiveResize = false;
resizeAmount = 2;
reverseSplit = false;
historyLimit = 5000;
newSession = true;
extraConfig = ''
# -------===[ Color Correction ]===------- #
set-option -ga terminal-overrides ",*256col*:Tc"
set-option -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor"
plugins = let
inherit (pkgs.tmuxPlugins) resurrect continuum;
in [
{
plugin = resurrect;
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
}
{
plugin = continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-save-interval '60' # minutes
'';
}
];
# -------===[ General-Configurations ]===------- #
set-option -g renumber-windows on
set-window-option -g automatic-rename on
set-window-option -g word-separators ' @"=()[]'
extraConfig = ''
# -------===[ Color Correction ]===------- #
set-option -ga terminal-overrides ",*256col*:Tc"
set-option -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor"
set-option -g mouse on
set-option -s focus-events on
set-option -g renumber-windows on
set-option -g allow-rename off
# -------===[ General-Configurations ]===------- #
set-option -g renumber-windows on
set-window-option -g automatic-rename on
set-window-option -g word-separators ' @"=()[]'
# -------===[ Activity/Sound ]===------- #
set-option -g bell-action none
set-option -g visual-bell off
set-option -g visual-silence off
set-option -g visual-activity off
set-window-option -g monitor-activity off
set-option -g mouse on
set-option -s focus-events on
set-option -g renumber-windows on
set-option -g allow-rename off
# -------===[ Status-Bar ]===------- #
set-option -g status on
set-option -g status-interval 1
set-option -g status-style bg=default,bold,italics
# -------===[ Activity/Sound ]===------- #
set-option -g bell-action none
set-option -g visual-bell off
set-option -g visual-silence off
set-option -g visual-activity off
set-window-option -g monitor-activity off
set-option -g status-position top
set-option -g status-justify left
# -------===[ Status-Bar ]===------- #
set-option -g status on
set-option -g status-interval 1
set-option -g status-style bg=default,bold,italics
set-option -g status-left-length "40"
set-option -g status-right-length "80"
set-option -g status-position top
set-option -g status-justify left
# -------===[ Keybindings ]===------- #
bind-key c clock-mode
set-option -g status-left-length "40"
set-option -g status-right-length "80"
# Window Control(s):
bind-key q kill-session
bind-key Q kill-server
bind-key t new-window -c '#{pane_current_path}'
# -------===[ Keybindings ]===------- #
bind-key c clock-mode
# Buffers:
bind-key b list-buffers
bind-key p paste-buffer
bind-key P choose-buffer
# Window Control(s):
bind-key q kill-session
bind-key Q kill-server
bind-key t new-window -c '#{pane_current_path}'
# Split bindings:
bind-key - split-window -v -c '#{pane_current_path}'
bind-key / split-window -h -c '#{pane_current_path}'
# Buffers:
bind-key b list-buffers
bind-key p paste-buffer
bind-key P choose-buffer
# Copy/Paste bindings:
bind-key -T copy-mode-vi v send-keys -X begin-selection -N "Start visual mode for selection"
bind-key -T copy-mode-vi y send-keys -X copy-selection -N "Yank text into buffer"
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle -N "Yank region into buffer"
'';
# Split bindings:
bind-key - split-window -v -c '#{pane_current_path}'
bind-key / split-window -h -c '#{pane_current_path}'
# Copy/Paste bindings:
bind-key -T copy-mode-vi v send-keys -X begin-selection -N "Start visual mode for selection"
bind-key -T copy-mode-vi y send-keys -X copy-selection -N "Yank text into buffer"
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle -N "Yank region into buffer"
'';
};
};
};
}

View file

@ -1,4 +1,4 @@
{ config, lib, user, ... }:
{ config, lib, pkgs, user, ... }:
let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
@ -11,8 +11,12 @@ in
};
config = mkIf cfg.enable {
home-manager.users.${user}.programs.yazi = {
enable = true;
home-manager.users.${user} = {
packages = with pkgs; [ yazi ];
programs.yazi = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, user, ... }:
let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.${user}.shell.toolset.zoxide;
in
{
options.modules.${user}.shell.toolset.zoxide = {
enable = mkEnableOption "system-monitor";
};
config = mkIf cfg.enable {
home-manager.users.${user} = {
packages = with pkgs; [ zoxide ];
programs.zoxide = {
enable = true;
};
};
};
}