This commit is contained in:
2025-11-15 23:45:33 +08:00
parent e7da80bb0c
commit b50e4e489c
15 changed files with 358 additions and 225 deletions
+39
View File
@@ -0,0 +1,39 @@
# Modern CLI tools and utilities
{
inputs,
lib,
config,
pkgs,
...
}: {
home.packages = with pkgs; [
# Modern replacements for standard tools
ripgrep # Better grep
fd # Better find
sd # Better sed
du-dust # Better du
duf # Better df
procs # Better ps
bottom # Better top/htop
# System monitoring
htop
# File utilities
tree
# Network tools
wget
curl
# Text processing
jq # JSON processor
yq-go # YAML processor
# Optional file managers (commented out by default)
# ranger
# nnn
# lf
];
}
+46
View File
@@ -0,0 +1,46 @@
# Development tools and utilities
{
inputs,
lib,
config,
pkgs,
...
}: {
home.packages = with pkgs; [
# Version control tools
gh # GitHub CLI
lazygit # Terminal UI for git
# Build tools
gnumake
cmake
# Optional language runtimes (uncomment as needed)
# python311
# nodejs_20
# go
# rustc
# cargo
# Docker and containers (Linux only, macOS uses Docker Desktop)
] ++ lib.optionals pkgs.stdenv.isLinux [
# docker
# docker-compose
];
# GitHub CLI configuration
programs.gh = {
enable = true;
settings = {
git_protocol = "ssh";
prompt = "enabled";
};
};
# Direnv for per-directory environments
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}
+27
View File
@@ -0,0 +1,27 @@
# Text editor configurations
{
inputs,
lib,
config,
pkgs,
...
}: {
# Neovim configuration
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
extraConfig = ''
set number
set relativenumber
set expandtab
set tabstop=2
set shiftwidth=2
set smartindent
set clipboard=unnamedplus
'';
};
}
+40
View File
@@ -0,0 +1,40 @@
# Git configuration - unified from common.nix and development.nix
{
inputs,
lib,
config,
pkgs,
...
}: {
programs.git = {
enable = true;
# TODO: Configure your git identity
# userName = "Your Name";
# userEmail = "your.email@example.com";
extraConfig = {
# From common.nix
init.defaultBranch = "main";
pull.rebase = true;
push.autoSetupRemote = true;
# From development.nix
core.editor = "vim";
merge.conflictstyle = "diff3";
diff.algorithm = "histogram";
};
# Git aliases
aliases = {
st = "status";
co = "checkout";
br = "branch";
ci = "commit";
unstage = "reset HEAD --";
last = "log -1 HEAD";
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
};
};
}
+47
View File
@@ -0,0 +1,47 @@
# Terminal multiplexer configurations
{
inputs,
lib,
config,
pkgs,
...
}: {
home.packages = with pkgs; [
# Optional multiplexers (tmux enabled by default below)
# zellij
];
# Tmux configuration
programs.tmux = {
enable = true;
terminal = "tmux-256color";
historyLimit = 10000;
baseIndex = 1;
keyMode = "vi";
mouse = true;
plugins = with pkgs.tmuxPlugins; [
sensible
yank
vim-tmux-navigator
];
extraConfig = ''
# Split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# Reload config
bind r source-file ~/.config/tmux/tmux.conf
# Easy pane switching
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
'';
};
}
+117
View File
@@ -0,0 +1,117 @@
# Shell configuration (bash, zsh, fish) with integrations
{
inputs,
lib,
config,
pkgs,
...
}: {
# Bash configuration
programs.bash = {
enable = true;
enableCompletion = true;
shellAliases = {
ll = "ls -la";
".." = "cd ..";
"..." = "cd ../..";
gs = "git status";
gd = "git diff";
};
};
# Zsh configuration
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "ls -la";
".." = "cd ..";
"..." = "cd ../..";
gs = "git status";
gd = "git diff";
nix-gc = "nix-collect-garbage -d";
};
history = {
size = 10000;
path = "${config.home.homeDirectory}/.zsh_history";
};
initExtra = ''
# Custom prompt or additional configuration
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_REDUCE_BLANKS
'';
};
# Fish configuration
programs.fish = {
enable = true;
shellAliases = {
ll = "ls -la";
".." = "cd ..";
"..." = "cd ../..";
gs = "git status";
gd = "git diff";
};
functions = {
mkcd = "mkdir -p $argv[1]; and cd $argv[1]";
};
};
# Starship prompt (works with all shells)
programs.starship = {
enable = true;
settings = {
add_newline = true;
character = {
success_symbol = "[](bold green)";
error_symbol = "[](bold red)";
};
package.disabled = true;
};
};
# Zoxide (better cd)
programs.zoxide = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
};
# fzf (fuzzy finder)
programs.fzf = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
};
# Eza (modern ls replacement)
programs.eza = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
git = true;
icons = true;
};
# Bat (better cat)
programs.bat = {
enable = true;
config = {
theme = "TwoDark";
pager = "less -FR";
};
};
}
@@ -0,0 +1,39 @@
# Terminal emulator configurations
{
inputs,
lib,
config,
pkgs,
...
}: {
# Alacritty terminal emulator configuration
programs.alacritty = {
enable = true;
settings = {
window = {
padding = {
x = 10;
y = 10;
};
decorations = "full";
opacity = 0.95;
};
font = {
size = 13.0;
normal = {
family = "JetBrainsMono Nerd Font";
style = "Regular";
};
};
colors = {
primary = {
background = "0x1e1e1e";
foreground = "0xd4d4d4";
};
};
};
};
}