Convert tmux config to Nix and personalize system configuration
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
./modules/shell.nix
|
||||
./modules/editor.nix
|
||||
./modules/git.nix
|
||||
./modules/dev-tools.nix
|
||||
./modules/tmux.nix
|
||||
];
|
||||
|
||||
# ============================================
|
||||
# Home Manager Shared Configuration
|
||||
# ============================================
|
||||
|
||||
home.username = "youruser";
|
||||
home.homeDirectory = "/home/youruser";
|
||||
home.username = "eliaskohout";
|
||||
home.homeDirectory = "/home/eliaskohout";
|
||||
home.stateVersion = "25.11";
|
||||
|
||||
# Home-level packages
|
||||
@@ -22,27 +22,49 @@
|
||||
tree
|
||||
unzip
|
||||
zip
|
||||
fzf
|
||||
bat
|
||||
exa
|
||||
tldr
|
||||
htop
|
||||
iotop
|
||||
# Container tools
|
||||
podman
|
||||
podman-compose
|
||||
|
||||
# Unstable packages (if needed)
|
||||
# pkgs-unstable.some-package
|
||||
];
|
||||
|
||||
|
||||
# Environment variables
|
||||
home.sessionVariables = {
|
||||
EDITOR = "vim";
|
||||
PAGER = "less";
|
||||
EDITOR = "nvim";
|
||||
SHELL = "/bin/zsh";
|
||||
PAGER = "bat";
|
||||
TERM = "tmux-256color";
|
||||
LESSHISTFILE = "${config.xdg.cacheHome}/less/lesshst";
|
||||
MANPATH = "$MANPATH:/usr/local/man";
|
||||
};
|
||||
home.sessionPath = [
|
||||
"${config.home.homeDirectory}/.local/scripts"
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
];
|
||||
|
||||
# Locale
|
||||
home.language = {
|
||||
base = "de_DE.UTF-8";
|
||||
};
|
||||
|
||||
# Create xdg envs
|
||||
xdg.enable = true;
|
||||
|
||||
# HM Modules
|
||||
programs.fzf.enable = true;
|
||||
programs.gpg.enable = true;
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableSshSupport = true;
|
||||
};
|
||||
|
||||
# Home Manager should manage itself
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# Locale
|
||||
home.language = {
|
||||
base = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
{ config, lib, pkgs, pkgs-unstable, ... }:
|
||||
|
||||
{
|
||||
# Development tools at user level
|
||||
home.packages = with pkgs; [
|
||||
# Debuggers
|
||||
lldb
|
||||
gdb
|
||||
|
||||
# Version managers
|
||||
fnm # Node version manager
|
||||
pyenv # Python version manager
|
||||
|
||||
# Build tools
|
||||
cmake
|
||||
ninja
|
||||
meson
|
||||
|
||||
# System tools
|
||||
tmux
|
||||
htop
|
||||
iotop
|
||||
|
||||
# Container tools
|
||||
podman
|
||||
podman-compose
|
||||
|
||||
# Cloud/Infrastructure
|
||||
# terraform
|
||||
# kubectl
|
||||
# helm
|
||||
|
||||
# Testing
|
||||
# pytest # Python
|
||||
# jest # JavaScript (via npm)
|
||||
];
|
||||
|
||||
# tmux configuration (optional)
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
baseIndex = 1;
|
||||
newSessionPath = "$HOME";
|
||||
shortcut = "a";
|
||||
|
||||
extraConfig = ''
|
||||
# Enable mouse
|
||||
set -g mouse on
|
||||
|
||||
# Vi-like navigation
|
||||
setw -g mode-keys vi
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
{ config, lib, pkgs, pkgs-unstable, ... }:
|
||||
|
||||
{
|
||||
# Neovim as primary editor
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
@@ -62,8 +61,4 @@
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
|
||||
# Alternative: VS Code (uncomment if preferred)
|
||||
# programs.vscode.enable = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Your Name"; # TODO: Customize
|
||||
userEmail = "your.email@example.com"; # TODO: Customize
|
||||
userName = "Elias Kohout";
|
||||
userEmail = "elias@kohout.de";
|
||||
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
@@ -13,18 +13,13 @@
|
||||
};
|
||||
|
||||
aliases = {
|
||||
st = "status";
|
||||
co = "checkout";
|
||||
br = "branch";
|
||||
ci = "commit";
|
||||
unstage = "reset HEAD --";
|
||||
last = "log -1 HEAD";
|
||||
visual = "log --graph --oneline --all";
|
||||
};
|
||||
};
|
||||
|
||||
# GPG key signing (optional, uncomment if using)
|
||||
# programs.gpg.enable = true;
|
||||
# services.gpg-agent.enable = true;
|
||||
|
||||
# GPG key signing
|
||||
programs.gpg.enable = true;
|
||||
services.gpg-agent.enable = true;
|
||||
}
|
||||
|
||||
@@ -1,40 +1,38 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
history = {
|
||||
path = "${config.xdg.configHome}/zsh/zsh_history";
|
||||
size = 10000;
|
||||
save = 10000;
|
||||
};
|
||||
|
||||
initExtra = ''
|
||||
# Custom shell initialization
|
||||
eval "$(direnv hook zsh)"
|
||||
eval "$(starship init zsh)"
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
bindkey '^S' history-incremental-search-forward
|
||||
'';
|
||||
|
||||
promptInit = ''
|
||||
autoload -Uz vcs_info
|
||||
precmd() { vcs_info }
|
||||
zstyle ':vcs_info:git:*' formats '%b'
|
||||
setopt PROMPT_SUBST
|
||||
PROMPT='%F{green}%n@%m%f:%F{blue}%~%f %F{240}''${vcs_info_msg_0_}%f %# '
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
ls = "exa -l";
|
||||
la = "exa -la";
|
||||
tree = "exa --tree";
|
||||
cat = "bat";
|
||||
cd = "z";
|
||||
};
|
||||
|
||||
plugins = [
|
||||
{
|
||||
name = "z";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "agkozak";
|
||||
repo = "zsh-z";
|
||||
rev = "v1.12.0";
|
||||
sha256 = "sha256-z7YhKUpn6uEEGT1iFSBpUG+w0D1M9YsvvZW8PwDh8T8=";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
programs.starship.enable = true;
|
||||
programs.direnv.enable = true;
|
||||
programs.direnv.nix-direnv.enable = true;
|
||||
|
||||
home.activation.createZshHistDir = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
mkdir -p "${config.xdg.configHome}/zsh"
|
||||
'';
|
||||
}
|
||||
|
||||
101
home/modules/tmux.nix
Normal file
101
home/modules/tmux.nix
Normal file
@@ -0,0 +1,101 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
|
||||
# Shell and terminal
|
||||
shell = "${pkgs.zsh}/bin/zsh";
|
||||
terminal = "tmux-256color";
|
||||
terminalOverrides = [ "*256col*:Tc" ];
|
||||
|
||||
# Indexing
|
||||
baseIndex = 1;
|
||||
paneBaseIndex = 1;
|
||||
renumberWindows = true;
|
||||
|
||||
# Mouse and clipboard
|
||||
mouse = false;
|
||||
setClipboard = true;
|
||||
|
||||
# History
|
||||
historyLimit = 50000;
|
||||
|
||||
# Status bar
|
||||
statusInterval = 1;
|
||||
statusPosition = "top";
|
||||
statusJustify = "left";
|
||||
statusStyle = "bg=black,fg=brightwhite";
|
||||
statusLeft = "#[bg=colour236,fg=brightwhite]#{?session_path, #(basename #{session_path}) ,}";
|
||||
statusRight = "#[bg=colour236,fg=brightwhite] #H #[bg=colour235,fg=brightwhite] %H:%M:%S ";
|
||||
statusLeftLength = 100;
|
||||
statusRightLength = 100;
|
||||
|
||||
# Window styling
|
||||
windowStatusFormat = " #[fg=white]#I:#[fg=white]#W#{?window_flags,#F,} ";
|
||||
windowStatusCurrentFormat = "#[bg=colour235,fg=brightred,bold] #I:#W#{?window_flags,#F,} ";
|
||||
windowStatusSeparator = "";
|
||||
|
||||
# Pane styling
|
||||
paneActiveBorderStyle = "fg=brightred";
|
||||
paneBorderStyle = "fg=colour238";
|
||||
|
||||
# Message styling
|
||||
messageStyle = "bg=colour236,fg=brightwhite";
|
||||
messageCommandStyle = "bg=colour236,fg=brightwhite";
|
||||
|
||||
# Mode and clock
|
||||
modeStyle = "bg=brightred,fg=black";
|
||||
clockModeColour = "brightred";
|
||||
clockModeStyle = 24;
|
||||
|
||||
# Copy mode
|
||||
copyMode = {
|
||||
vi = true;
|
||||
};
|
||||
|
||||
# Keybindings
|
||||
keyBindings = [
|
||||
{
|
||||
key = "y";
|
||||
command = "copy-mode";
|
||||
}
|
||||
{
|
||||
key = "h";
|
||||
command = "select-pane -L";
|
||||
options = { repeat = true; };
|
||||
}
|
||||
{
|
||||
key = "j";
|
||||
command = "select-pane -D";
|
||||
options = { repeat = true; };
|
||||
}
|
||||
{
|
||||
key = "k";
|
||||
command = "select-pane -U";
|
||||
options = { repeat = true; };
|
||||
}
|
||||
{
|
||||
key = "l";
|
||||
command = "select-pane -R";
|
||||
options = { repeat = true; };
|
||||
}
|
||||
{
|
||||
key = "r";
|
||||
command = "source-file ~/.config/tmux/tmux.conf \\; display-message \"tmux.conf reloaded\"";
|
||||
options = { repeat = true; };
|
||||
}
|
||||
{
|
||||
key = "q";
|
||||
command = "display-popup -E -w 60% -h 60% -d '#{session_path}' 'nvim quicknote.md'";
|
||||
}
|
||||
];
|
||||
|
||||
# Additional settings via extraConfig
|
||||
extraConfig = ''
|
||||
set -ga terminal-overrides ",*256col*:Tc"
|
||||
set -g focus-events on
|
||||
set -g pane-border-lines heavy
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user