confix/home-manager/all.nix

142 lines
3.7 KiB
Nix
Raw Normal View History

# All home.nix
2023-07-31 00:21:32 -04:00
{ 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;
};
2023-07-31 00:21:32 -04:00
programs.git = {
enable = true;
userName = "${user.long}";
userEmail = "${user.email}";
ignores = [
"*~"
"*.swp"
];
};
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
extraConfig = ''
syntax enable
set wrap
set linebreak
set number
set relativenumber
set splitbelow
set splitright
'';
};
programs.lf = {
enable = true;
2023-07-31 00:21:32 -04:00
};
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"'
2023-07-31 00:21:32 -04:00
# Reload tmux.conf
unbind r
bind r source-file $HOME/.config/tmux/tmux.conf \; display "tmux config reloaded"
2023-07-31 00:21:32 -04:00
# 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}"
2023-07-31 00:21:32 -04:00
unbind a
bind a new-window
2023-07-31 00:21:32 -04:00
unbind l
unbind Tab
bind Tab last-window
2023-07-31 00:21:32 -04:00
# 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
2023-07-31 00:21:32 -04:00
# Set status bar postition
set -g status-position top
2023-07-31 00:21:32 -04:00
# Status bar theme
set -g status-style "fg=#50fa7b"
2023-07-31 00:21:32 -04:00
# 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]"
2023-07-31 00:21:32 -04:00
'';
plugins = with pkgs; [
tmuxPlugins.cpu
{
plugin = tmuxPlugins.resurrect;
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
}
{
plugin = tmuxPlugins.continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-save-interval '60' # minutes
'';
}
];
prefix = "C-b";
};
home.stateVersion = "23.05";
}