refactor(home-manager): refine CLI feature configurations
- Add direnv module with nix-direnv integration, replacing manual hook - Disable starship's add_newline for more compact prompt - Clean up comments across CLI features for better readability
This commit is contained in:
parent
bdf7c14c6c
commit
e18635be43
5 changed files with 26 additions and 22 deletions
15
home-manager/sajenim/features/cli/direnv.nix
Normal file
15
home-manager/sajenim/features/cli/direnv.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
# Automatic environment variable management per-directory
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
|
||||
# Faster nix-shell integration with dependency caching
|
||||
nix-direnv.enable = true;
|
||||
|
||||
# Hook into zsh
|
||||
enableZshIntegration = true;
|
||||
|
||||
# Suppress logging output
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -3,13 +3,13 @@
|
|||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
# Left prompt: username@hostname directory git ♥
|
||||
format = "$username$hostname$directory$git_branch$git_status$character";
|
||||
add_newline = false;
|
||||
|
||||
# Right prompt: language indicators
|
||||
# Prompt layout
|
||||
format = "$username$hostname$directory$git_branch$git_status$character";
|
||||
right_format = "$c$direnv$haskell$bun$python$rust";
|
||||
|
||||
# Blue username
|
||||
# Always show username
|
||||
username = {
|
||||
style_user = "blue";
|
||||
style_root = "red";
|
||||
|
|
@ -17,14 +17,14 @@
|
|||
show_always = true;
|
||||
};
|
||||
|
||||
# Blue @hostname
|
||||
# Show hostname even when not over SSH
|
||||
hostname = {
|
||||
ssh_only = false;
|
||||
format = "[@$hostname]($style) ";
|
||||
style = "blue";
|
||||
};
|
||||
|
||||
# Cyan directory
|
||||
# Full path, no truncation
|
||||
directory = {
|
||||
style = "cyan";
|
||||
format = "[$path]($style) ";
|
||||
|
|
@ -32,12 +32,10 @@
|
|||
truncate_to_repo = false;
|
||||
};
|
||||
|
||||
# Git branch (purple, no bold)
|
||||
git_branch = {
|
||||
style = "purple";
|
||||
};
|
||||
# Git configuration
|
||||
git_branch.style = "purple";
|
||||
|
||||
# Git status with semantic colors (no bold, no brackets)
|
||||
# Semantic colors for git status indicators
|
||||
git_status = {
|
||||
format = "$conflicted$stashed$deleted$renamed$modified$staged$untracked$ahead_behind";
|
||||
conflicted = "[=$count](red) ";
|
||||
|
|
@ -52,19 +50,14 @@
|
|||
deleted = "[✘$count](red) ";
|
||||
};
|
||||
|
||||
# Heart prompt character (red in insert mode, blue in normal mode)
|
||||
# Vi-mode aware prompt character
|
||||
character = {
|
||||
success_symbol = "[♥](red)";
|
||||
error_symbol = "[♥](red)";
|
||||
vicmd_symbol = "[♥](blue)";
|
||||
};
|
||||
|
||||
# Language modules for right prompt (only configure non-defaults)
|
||||
|
||||
# Enable direnv (disabled by default)
|
||||
direnv.disabled = false;
|
||||
|
||||
# C, Python, Haskell, Bun, Rust: use defaults
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./direnv.nix
|
||||
./starship.nix
|
||||
];
|
||||
|
||||
|
|
@ -47,7 +48,6 @@
|
|||
|
||||
# Extra commands that should be added to '.zshrc'
|
||||
initContent = ''
|
||||
eval "$(direnv hook zsh)"
|
||||
bindkey "^[[1;5C" forward-word
|
||||
bindkey "^[[1;5D" backward-word
|
||||
export PATH
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@
|
|||
# Configure programs
|
||||
programs = {
|
||||
zsh.enable = true;
|
||||
# Load and unload environment variables
|
||||
direnv.enable = true;
|
||||
# Android debug bridge: communicate with devices
|
||||
adb.enable = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@
|
|||
# Configure programs
|
||||
programs = {
|
||||
zsh.enable = true;
|
||||
# Load and unload environment variables
|
||||
direnv.enable = true;
|
||||
};
|
||||
|
||||
# Manage linux containers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue