refactor: move max into dentritic pattern
This commit is contained in:
21
modules/common/features/development/alacritty.nix
Normal file
21
modules/common/features/development/alacritty.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.commonFeatureAlacritty = { ... }: {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
theme = "tokyo_night";
|
||||
settings = {
|
||||
window = {
|
||||
padding = { x = 14; y = 14; };
|
||||
};
|
||||
font = {
|
||||
normal.family = "JetBrainsMono Nerd Font";
|
||||
size = 10;
|
||||
};
|
||||
keyboard.bindings = [
|
||||
{ key = "Insert"; mods = "Shift"; action = "Paste"; }
|
||||
{ key = "Insert"; mods = "Control"; action = "Copy"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/common/features/development/direnv.nix
Normal file
10
modules/common/features/development/direnv.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.commonFeatureDirenv = { ... }: {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
nix-direnv.enable = true;
|
||||
silent = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/common/features/development/lf.nix
Normal file
5
modules/common/features/development/lf.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.commonFeatureLf = { ... }: {
|
||||
programs.lf = { enable = true; };
|
||||
};
|
||||
}
|
||||
6
modules/common/features/development/starship.nix
Normal file
6
modules/common/features/development/starship.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.commonFeatureStarship = { ... }: {
|
||||
programs.starship.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
21
modules/common/features/development/tmux.nix
Normal file
21
modules/common/features/development/tmux.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.commonFeatureTmux = { pkgs, ... }: {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
mouse = true;
|
||||
keyMode = "vi";
|
||||
shell = "${pkgs.zsh}/bin/zsh";
|
||||
extraConfig = ''
|
||||
set -g status-style bg=default
|
||||
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
|
||||
set -g default-terminal "tmux-256color"
|
||||
set -ga terminal-overrides ",alacritty:Tc"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
92
modules/common/features/development/zsh.nix
Normal file
92
modules/common/features/development/zsh.nix
Normal file
@@ -0,0 +1,92 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.commonFeatureZsh = { pkgs, config, ... }: {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion = {
|
||||
enable = true;
|
||||
};
|
||||
syntaxHighlighting.enable = true;
|
||||
dotDir = "${config.home.homeDirectory}/.config/zsh";
|
||||
autocd = true;
|
||||
|
||||
initContent = ''
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
|
||||
zstyle ':completion:*' menu select
|
||||
|
||||
fzf-project() {
|
||||
selected=$(find ~/dev -mindepth 2 -maxdepth 2 | sed 's|/home/max/dev/||' | fzf --delimiter '/' --nth 2)
|
||||
if [[ -n $selected ]]; then
|
||||
cd ~/dev/$selected
|
||||
zle reset-prompt
|
||||
fi
|
||||
zle redisplay
|
||||
}
|
||||
|
||||
zle -N fzf-project
|
||||
bindkey '^G' fzf-project
|
||||
|
||||
fzf-files() {
|
||||
local selected
|
||||
selected=$(${pkgs.ripgrep}/bin/rg --files | ${pkgs.fzf}/bin/fzf) || return
|
||||
|
||||
if [[ -n $selected ]]; then
|
||||
BUFFER="v $selected"
|
||||
print -s -- "$BUFFER"
|
||||
zle accept-line
|
||||
fi
|
||||
}
|
||||
|
||||
zle -N fzf-files
|
||||
bindkey '^V' fzf-files
|
||||
|
||||
open() {
|
||||
xdg-open "$@" >/dev/null 2>&1 &
|
||||
}
|
||||
'';
|
||||
|
||||
envExtra = ''
|
||||
export PER_DIRECTORY_HISTORY_TOGGLE="^H"
|
||||
export HISTORY_BASE="$HOME/.local/share/directory_history"
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
ll = "ls -alh";
|
||||
v = "nvim";
|
||||
vi = "nvim";
|
||||
vim = "nvim";
|
||||
|
||||
p = "pnpm";
|
||||
g = "pnpm run build && ~/dev/personal/genesis/packages/genesis/dist/bin.js";
|
||||
|
||||
ns = "nix-shell --run zsh -p";
|
||||
|
||||
tt = "tt -notheme -n 10";
|
||||
|
||||
bible = "nvim ~/bible.txt -R";
|
||||
notes = "nvim ~/notes";
|
||||
home = "sudo nvim /etc/nixos/home.nix";
|
||||
wttr = "curl wttr.in/Clemson";
|
||||
|
||||
docx-to-pdf = "libreoffice --headless --convert-to pdf";
|
||||
};
|
||||
|
||||
plugins = [
|
||||
{
|
||||
name = "vi-mode";
|
||||
src = pkgs.zsh-vi-mode;
|
||||
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "per-directory-history";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jimhester";
|
||||
repo = "per-directory-history";
|
||||
rev = "95f06973e9f2ff0ff75f3cebd0a2ee5485e27834";
|
||||
sha256 = "sha256-EV9QPBndwAWzdOcghDXrIIgP0oagVMOTyXzoyt8tXRo=";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user