Convert tmux config to Nix and personalize system configuration
This commit is contained in:
@@ -5,15 +5,15 @@
|
|||||||
./modules/shell.nix
|
./modules/shell.nix
|
||||||
./modules/editor.nix
|
./modules/editor.nix
|
||||||
./modules/git.nix
|
./modules/git.nix
|
||||||
./modules/dev-tools.nix
|
./modules/tmux.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# Home Manager Shared Configuration
|
# Home Manager Shared Configuration
|
||||||
# ============================================
|
# ============================================
|
||||||
|
|
||||||
home.username = "youruser";
|
home.username = "eliaskohout";
|
||||||
home.homeDirectory = "/home/youruser";
|
home.homeDirectory = "/home/eliaskohout";
|
||||||
home.stateVersion = "25.11";
|
home.stateVersion = "25.11";
|
||||||
|
|
||||||
# Home-level packages
|
# Home-level packages
|
||||||
@@ -22,27 +22,49 @@
|
|||||||
tree
|
tree
|
||||||
unzip
|
unzip
|
||||||
zip
|
zip
|
||||||
fzf
|
|
||||||
bat
|
bat
|
||||||
exa
|
|
||||||
tldr
|
tldr
|
||||||
|
htop
|
||||||
|
iotop
|
||||||
|
# Container tools
|
||||||
|
podman
|
||||||
|
podman-compose
|
||||||
|
|
||||||
# Unstable packages (if needed)
|
# Unstable packages (if needed)
|
||||||
# pkgs-unstable.some-package
|
# pkgs-unstable.some-package
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "vim";
|
EDITOR = "nvim";
|
||||||
PAGER = "less";
|
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
|
# Home Manager should manage itself
|
||||||
programs.home-manager.enable = true;
|
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, ... }:
|
{ config, lib, pkgs, pkgs-unstable, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Neovim as primary editor
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
@@ -62,8 +61,4 @@
|
|||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Alternative: VS Code (uncomment if preferred)
|
|
||||||
# programs.vscode.enable = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
{
|
{
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
userName = "Your Name"; # TODO: Customize
|
userName = "Elias Kohout";
|
||||||
userEmail = "your.email@example.com"; # TODO: Customize
|
userEmail = "elias@kohout.de";
|
||||||
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
@@ -13,18 +13,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
aliases = {
|
aliases = {
|
||||||
st = "status";
|
|
||||||
co = "checkout";
|
|
||||||
br = "branch";
|
|
||||||
ci = "commit";
|
|
||||||
unstage = "reset HEAD --";
|
unstage = "reset HEAD --";
|
||||||
last = "log -1 HEAD";
|
last = "log -1 HEAD";
|
||||||
visual = "log --graph --oneline --all";
|
visual = "log --graph --oneline --all";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# GPG key signing (optional, uncomment if using)
|
# GPG key signing
|
||||||
# programs.gpg.enable = true;
|
programs.gpg.enable = true;
|
||||||
# services.gpg-agent.enable = true;
|
services.gpg-agent.enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,38 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
dotDir = ".config/zsh";
|
||||||
autosuggestion.enable = true;
|
autosuggestion.enable = true;
|
||||||
syntaxHighlighting.enable = true;
|
syntaxHighlighting.enable = true;
|
||||||
|
|
||||||
|
history = {
|
||||||
|
path = "${config.xdg.configHome}/zsh/zsh_history";
|
||||||
|
size = 10000;
|
||||||
|
save = 10000;
|
||||||
|
};
|
||||||
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
# Custom shell initialization
|
bindkey '^R' history-incremental-search-backward
|
||||||
eval "$(direnv hook zsh)"
|
bindkey '^S' history-incremental-search-forward
|
||||||
eval "$(starship init zsh)"
|
'';
|
||||||
|
|
||||||
|
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 = {
|
shellAliases = {
|
||||||
ls = "exa -l";
|
|
||||||
la = "exa -la";
|
|
||||||
tree = "exa --tree";
|
|
||||||
cat = "bat";
|
cat = "bat";
|
||||||
cd = "z";
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
plugins = [
|
home.activation.createZshHistDir = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
{
|
mkdir -p "${config.xdg.configHome}/zsh"
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
git
|
git
|
||||||
curl
|
curl
|
||||||
wget
|
|
||||||
vim
|
vim
|
||||||
htop
|
htop
|
||||||
];
|
];
|
||||||
@@ -35,10 +34,9 @@
|
|||||||
|
|
||||||
# System-wide locale
|
# System-wide locale
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
time.timeZone = "UTC";
|
time.timeZone = "Europe/Berlin";
|
||||||
|
|
||||||
# Networking basics
|
# Networking basics
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
networking.networkmanager.enable = lib.mkDefault false;
|
networking.networkmanager.enable = lib.mkDefault false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
languagePackages = {
|
languagePackages = {
|
||||||
rust = with pkgs; [ rustup cargo-deny cargo-edit ];
|
rust = with pkgs; [ rustup cargo-deny cargo-edit ];
|
||||||
python = with pkgs; [ python3 python3Packages.pip python3Packages.virtualenv ];
|
python = with pkgs; [ python3 python3Packages.pip python3Packages.virtualenv uv ];
|
||||||
nodejs = with pkgs; [ nodejs npm pnpm ];
|
nodejs = with pkgs; [ nodejs npm pnpm ];
|
||||||
go = with pkgs; [ go golangci-lint ];
|
go = with pkgs; [ go golangci-lint ];
|
||||||
ruby = with pkgs; [ ruby bundler ];
|
ruby = with pkgs; [ ruby bundler ];
|
||||||
@@ -35,16 +35,12 @@
|
|||||||
gcc
|
gcc
|
||||||
clang
|
clang
|
||||||
cmake
|
cmake
|
||||||
gdb
|
|
||||||
ripgrep
|
ripgrep
|
||||||
fd
|
|
||||||
jq
|
jq
|
||||||
yq-go
|
|
||||||
] ++ selectedPackages;
|
] ++ selectedPackages;
|
||||||
|
|
||||||
# Enable container support (optional)
|
# Enable container support (optional)
|
||||||
virtualisation.docker.enable = true;
|
#virtualisation.docker.enable = true;
|
||||||
virtualisation.docker.enableOnBoot = false;
|
#virtualisation.docker.enableOnBoot = false;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
defaultShell = lib.mkOption {
|
defaultShell = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "zsh";
|
default = "zsh";
|
||||||
description = "Default shell (bash, zsh, fish)";
|
description = "Default shell (dash, zsh, fish)";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -15,13 +15,11 @@
|
|||||||
in lib.mkIf cfg.enable {
|
in lib.mkIf cfg.enable {
|
||||||
|
|
||||||
programs.zsh.enable = cfg.defaultShell == "zsh";
|
programs.zsh.enable = cfg.defaultShell == "zsh";
|
||||||
programs.bash.enable = true;
|
programs.dash.enable = true;
|
||||||
programs.fish.enable = cfg.defaultShell == "fish";
|
programs.fish.enable = cfg.defaultShell == "fish";
|
||||||
|
|
||||||
# Common shell packages
|
# Common shell packages
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
starship
|
|
||||||
direnv
|
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
config = lib.mkIf config.custom.system.enable {
|
config = lib.mkIf config.custom.system.enable {
|
||||||
# System-wide settings
|
# System-wide settings
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "25.11";
|
||||||
|
|
||||||
# Users
|
# Users
|
||||||
users.users.youruser = {
|
users.users.eliaskohout = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [ "wheel" "docker" ];
|
extraGroups = [ "wheel" "docker" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
|
|||||||
Reference in New Issue
Block a user