143 lines
3.6 KiB
Nix
143 lines
3.6 KiB
Nix
# All home.nix
|
|
{ config, lib, pkgs, inputs, user, ... }:
|
|
{
|
|
programs.home-manager.enable = true;
|
|
home.username = "${user.name}";
|
|
home.homeDirectory = "/home/${user.name}";
|
|
home.sessionPath = [
|
|
"${config.home.homeDirectory}/.local/bin"
|
|
];
|
|
xdg = {
|
|
enable = true;
|
|
cacheHome = "${config.home.homeDirectory}/.cache";
|
|
configHome = "${config.home.homeDirectory}/.config";
|
|
dataHome = "${config.home.homeDirectory}/.local/share";
|
|
stateHome = "${config.home.homeDirectory}/.local/state";
|
|
};
|
|
home.file = {
|
|
"bash_login" = {
|
|
source = ./dots/bash_login;
|
|
target = ".bash_login";
|
|
};
|
|
"bash_logout" = {
|
|
source = ./dots/bash_logout;
|
|
target = ".bash_logout";
|
|
};
|
|
"bashrc" = {
|
|
source = ./dots/bashrc;
|
|
target = ".bashrc";
|
|
};
|
|
};
|
|
programs.fzf = {
|
|
enable = true;
|
|
tmux.enableShellIntegration = true;
|
|
};
|
|
programs.git = {
|
|
enable = true;
|
|
userName = "${user.long}";
|
|
userEmail = "${user.email}";
|
|
ignores = [
|
|
"*~"
|
|
"*.swp"
|
|
];
|
|
extraConfig = {
|
|
global = {
|
|
init.defaultbranch = "main";
|
|
};
|
|
};
|
|
};
|
|
programs.neovim = {
|
|
enable = true;
|
|
defaultEditor = true;
|
|
viAlias = true;
|
|
vimAlias = true;
|
|
extraConfig = ''
|
|
syntax enable
|
|
set nowrap
|
|
set linebreak
|
|
set number
|
|
set relativenumber
|
|
set splitbelow
|
|
set splitright
|
|
set tabstop=2
|
|
set shiftwidth=2
|
|
'';
|
|
};
|
|
programs.lf = {
|
|
enable = true;
|
|
};
|
|
programs.password-store = {
|
|
enable = true;
|
|
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp exts.pass-import ]);
|
|
settings = {
|
|
PASSWORD_STORE_DIR = "XDG_DATA_HOME/password-store";
|
|
PASSWORD_STORE_CLIP_TIME = "60";
|
|
};
|
|
};
|
|
programs.tmux = {
|
|
enable = true;
|
|
baseIndex = 1;
|
|
clock24 = true;
|
|
keyMode = "vi";
|
|
mouse = false;
|
|
newSession = true;
|
|
extraConfig = ''
|
|
# Do not rename windows automatically
|
|
set-option -g allow-rename off
|
|
|
|
# Hide statusbar while using one window
|
|
set -g status off
|
|
set-hook -g after-new-window 'if "[ #{session_windows} -gt 1 ]" "set status on"'
|
|
set-hook -g after-kill-pane 'if "[ #{session_windows} -lt 2 ]" "set status off"'
|
|
set-hook -g pane-exited 'if "[ #{session_windows} -lt 2 ]" "set status off"'
|
|
set-hook -g window-layout-changed 'if "[ #{session_windows} -lt 2 ]" "set status off"'
|
|
|
|
# Reload tmux.conf
|
|
unbind r
|
|
bind r source-file $HOME/.config/tmux/tmux.conf \; display "tmux config reloaded"
|
|
|
|
# Rebind vertical/horizontal splitting
|
|
unbind v
|
|
unbind c
|
|
unbind %
|
|
unbind '"'
|
|
bind v split-window -h -c "#{pane_current_path}"
|
|
bind c split-window -v -c "#{pane_current_path}"
|
|
|
|
unbind a
|
|
bind a new-window
|
|
|
|
unbind l
|
|
unbind Tab
|
|
bind Tab last-window
|
|
|
|
# Rebind moving panes
|
|
bind -n C-h select-pane -L
|
|
bind -n C-j select-pane -D
|
|
bind -n C-k select-pane -U
|
|
bind -n C-l select-pane -R
|
|
bind -n M-h select-pane -L
|
|
bind -n M-j select-pane -D
|
|
bind -n M-k select-pane -U
|
|
bind -n M-l select-pane -R
|
|
|
|
# Set status bar postition
|
|
set -g status-position top
|
|
|
|
# Status bar theme
|
|
set -g status-style "fg=#50fa7b"
|
|
|
|
# Window theme
|
|
setw -g window-status-current-style "bg=#50fa7b fg=#282a36"
|
|
setw -g window-status-current-format " #I:#W#F "
|
|
setw -g window-status-format "[#I:#W#F]"
|
|
'';
|
|
plugins = with pkgs; [
|
|
tmuxPlugins.urlview
|
|
tmuxPlugins.yank
|
|
];
|
|
prefix = "C-b";
|
|
};
|
|
home.stateVersion = "23.05";
|
|
}
|