refactor to use common components

This commit is contained in:
RingOfStorms (Josh) 2024-05-11 12:07:42 -05:00
parent 1ec7eadcb8
commit c3644453ca
12 changed files with 62 additions and 222 deletions

View file

@ -12,6 +12,7 @@
"h001" = {
identityFile = age.secrets.nix2h001.path;
# TODO come back to these 10.12.14.## addrs and change them to intranet IP's instead of local network.
# LOCAL HOME NETWORK ONLY
hostname = "10.12.14.2";
user = "root";
};
@ -32,6 +33,11 @@
}
];
};
"l001" = {
identityFile = age.secrets.nix2l001.path;
hostname = "172.105.22.34";
user = "root";
};
};
};
}

View file

@ -1,4 +1,4 @@
{ lib, ylib, settings, ... }:
{ settings, ... }:
{
imports = [
(settings.usersDir + "/_common/components/home_manager/tmux/tmux.nix")

View file

@ -1,13 +0,0 @@
{ ... }:
{
programs.atuin = {
enable = true;
enableZshIntegration = true;
flags = [ "--disable-up-arrow" ];
settings = {
workspaces = true;
exit-mode = "return-query";
enter_accept = true;
};
};
}

View file

@ -1,43 +0,0 @@
{ ... }:
{
programs.starship = {
enable = true;
enableZshIntegration = true;
settings = {
add_newline = false;
palette = "catppuccin_coal";
palettes.catppuccin_coal = {
# Same as catppuccin mocha for these
rosewater = "#f5e0dc";
flamingo = "#f2cdcd";
pink = "#f5c2e7";
mauve = "#cba6f7";
red = "#f38ba8";
maroon = "#eba0ac";
peach = "#fab387";
yellow = "#f9e2af";
green = "#a6e3a1";
teal = "#94e2d5";
sky = "#89dceb";
sapphire = "#74c7ec";
blue = "#89b4fa";
lavender = "#b4befe";
# Coal variant: https://gist.github.com/RingOfStorms/b2ff0c4e37f5be9f985c72c3ec9a3e62
text = "#e0e0e0";
subtext1 = "#cccccc";
subtext0 = "#b8b8b8";
overlay2 = "#a3a3a3";
overlay1 = "#8c8c8c";
overlay0 = "#787878";
surface2 = "#636363";
surface1 = "#4f4f4f";
surface0 = "#3b3b3b";
base = "#262626";
mantle = "#1f1f1f";
crust = "#171717";
};
};
};
}

View file

@ -1,61 +0,0 @@
# Reset everything then add what we want exactly
unbind-key -a
bind C-Space send-prefix
# Windows
bind -r p previous-window
bind -r n next-window
bind -r & kill-window
bind -r c new-window -c "#{pane_current_path}"
bind ',' command-prompt "rename-window %%"
bind "\|" split-window -h -c "#{pane_current_path}"
bind "\\" split-window -v -c "#{pane_current_path}"
bind w choose-tree -Zw
bind -r 1 select-window -t:1
bind -r 2 select-window -t:2
bind -r 3 select-window -t:3
bind -r 4 select-window -t:4
bind -r 5 select-window -t:5
bind -r 6 select-window -t:6
bind -r 7 select-window -t:7
bind -r 8 select-window -t:8
bind -r 9 select-window -t:9
# custom
bind m command-prompt -p "Swap with window index:" "swap-window -t '%%'"
bind -r [ swap-window -t -1 \; previous-window
bind -r ] swap-window -t +1 \; next-window
# Panes
bind ! break-pane
bind -r left select-pane -L
bind -r down select-pane -D
bind -r up select-pane -U
bind -r right select-pane -R
bind -r x kill-pane
bind -r space resize-pane -Z
bind S select-layout tiled
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
# Sessions
bind $ command-prompt "rename-session %%"
bind -r ) switch-client -n
bind -r ( switch-client -p
# custom
bind C command-prompt -p "session name:" "new-session -s '%%'"
# Tmux util
bind : command-prompt
bind C-D detach
# ==========
# My options
set-option -g terminal-overrides ',xterm-256color:RGB'
set -g detach-on-destroy off
set -g renumber-windows on
set -g status-position top
set -sg escape-time 0

View file

@ -1,65 +0,0 @@
{ settings, lib, pkgs, ... } @ args:
let
tmux = pkgs.tmuxPlugins;
in
{
# home manager doesn't give us an option to add tmux extra config at the top so we do it ourselves here.
xdg.configFile."tmux/tmux.conf".text = lib.mkBefore (builtins.readFile ./tmux-reset.conf);
programs.tmux = {
enable = true;
# Revisit this later, permission denied to make anything in `/run` as my user...
secureSocket = false;
# default is B switch to space for easier dual hand use
shortcut = "Space";
prefix = "C-Space";
baseIndex = 1;
mouse = true;
keyMode = "vi";
shell = "${pkgs.zsh}/bin/zsh";
terminal = "screen-256color";
aggressiveResize = true;
sensibleOnTop = false;
plugins = [
{
plugin = tmux.catppuccin.overrideAttrs (_: {
src = pkgs.fetchFromGitHub {
owner = "ringofstorms";
repo = "tmux-catppuccin-coal";
rev = "e6d7c658e2d11798912ca1ed4e3626e3e1fad3fc";
sha256 = "sha256-M1XAeCz/lqgjZ7CnWCykJxZCDk+WVoawwHrR9SEO9ns=";
};
});
extraConfig = ''
set -g @catppuccin_flavour 'mocha'
set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
set -g @catppuccin_window_middle_separator " "
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W#{?window_zoomed_flag,(),}"
set -g @catppuccin_status_modules_right "directory application date_time"
set -g @catppuccin_status_modules_left "session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator " "
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_directory_text "#{b:pane_current_path}"
set -g @catppuccin_date_time_text "%H:%M"
'';
}
];
};
home.shellAliases = {
t = "tmux";
tat = "tmux ls 2>/dev/null && tmux attach-session -t \"$(tmux ls | head -n1 | cut -d: -f1)\" || tmux new-session";
};
}

View file

@ -1,9 +0,0 @@
{ ... }:
{
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = [ "--cmd cd" ];
};
}

View file

@ -1,29 +0,0 @@
{ ... }:
{
programs.zsh = {
enable = true;
autosuggestion.enable = true;
shellAliases = { };
defaultKeymap = "emacs";
initExtra = ''
# Make home/end and ctrl + left/right nav how I expect them to like in bash
bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
bindkey '^[[1;5D' emacs-backward-word
bindkey '^[[1;5C' emacs-forward-word
# Auto completion/suggestions/and case insensitivity
autoload -Uz compinit && compinit
setopt correct
setopt extendedglob
setopt nocaseglob
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case insensitive tab completion
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}" # Colored completion (different colors for dirs/files/etc)
zstyle ':completion:*' rehash true # automatically find new executables in path
'';
};
}

View file

@ -0,0 +1,12 @@
{ settings, ... }:
{
imports = [
(settings.usersDir + "/_common/components/home_manager/tmux/tmux.nix")
(settings.usersDir + "/_common/components/home_manager/atuin.nix")
(settings.usersDir + "/_common/components/home_manager/starship.nix")
(settings.usersDir + "/_common/components/home_manager/zoxide.nix")
(settings.usersDir + "/_common/components/home_manager/zsh.nix")
];
}