home-manager/home.nix

128 lines
3.2 KiB
Nix
Raw Normal View History

2024-12-26 16:55:11 -08:00
{ lib, pkgs, ... }:
{
home = {
packages = with pkgs; [
2024-12-26 17:35:51 -08:00
# Version Control
2024-12-26 16:55:11 -08:00
git jujutsu
2024-12-26 23:08:28 -08:00
# Terminal
# kitty # Broken (GLFWindow error)
zsh
fzf
2024-12-26 16:55:11 -08:00
];
username = "drew";
homeDirectory = "/home/drew";
stateVersion = "23.11";
2024-12-26 17:23:13 -08:00
2024-12-26 17:24:20 -08:00
};
programs = {
home-manager.enable = true;
2024-12-26 17:23:13 -08:00
2024-12-26 17:24:20 -08:00
git = {
enable = true;
userEmail = "dgalbraith33@gmail.com";
userName = "Drew Galbraith";
extraConfig = {
core = {
editor = "vim";
2024-12-26 17:23:13 -08:00
};
2024-12-26 17:24:20 -08:00
init.defaultBranch = "main";
2024-12-26 17:23:13 -08:00
};
};
2024-12-26 23:08:28 -08:00
zsh = {
enable = true;
history = {
path = "$HOME/.zsh_history";
share = true;
size = 10000;
save = 10000;
};
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ls = "ls --color";
ll = "ls -al";
la = "ls -a";
config="/usr/bin/git --git-dir=/home/drew/.cfg/ --work-tree=/home/drew'";
};
sessionVariables = {
EDITOR = "nvim";
PATH = "$HOME/.cargo/bin:$HOME/opt/cross/bin:$HOME/.local/bin:$PATH";
};
antidote = {
enable = true;
plugins = [
"zsh-users/zsh-autosuggestions kind:defer"
];
};
initExtraFirst = ''
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "$${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-$${(%):-%n}.zsh" ]]; then
source "$${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-$${(%):-%n}.zsh"
fi
'';
initExtra = ''
setopt extendedglob
bindkey -v
source <(fzf --zsh)
eval $(dircolors ~/.dir_colors)
# Bind keys
typeset -g -A key
bindkey -- "^[[H" beginning-of-line
bindkey -- "^[[F" end-of-line
bindkey -- "^[[1;5C" forward-word
bindkey -- "^[[1;5D" backward-word
bindkey -- "^[[3~" delete-char
# Update cursor based on mode
function zle-line-init zle-keymap-select {
case $KEYMAP in
vicmd) echo -n '\e[1 q';;
viins|main) echo -n '\e[5 q';;
esac
}
zle -N zle-line-init
zle -N zle-keymap-select
# Autocompletion.
autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
source ~/.nix-profile/etc/profile.d/hm-session-vars.sh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
'';
};
2024-12-26 16:55:11 -08:00
};
2024-12-26 17:35:51 -08:00
xdg.configFile = {
# Add kitty manually since there is an error with running it after installed with homemanager.
"kitty/Tomorrow_Night_Eighties.conf".source = ./kitty/Tomorrow_Night_Eighties.conf;
"kitty/kitty.conf".source = ./kitty/kitty.conf;
};
2024-12-26 23:08:28 -08:00
home.file = {
".p10k.zsh".source = ./zsh/.p10k.zsh;
};
2024-12-26 16:55:11 -08:00
}