home-manager/home.nix

359 lines
8.4 KiB
Nix
Raw Normal View History

2024-09-27 03:13:27 +02:00
{
config,
lib,
pkgs,
...
}:
2024-08-18 19:31:22 +02:00
{
2024-09-01 06:49:36 +02:00
nixpkgs.config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
2024-08-18 19:31:22 +02:00
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "jas";
home.homeDirectory = "/home/jas";
home.stateVersion = "24.05"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
2024-09-24 23:55:02 +02:00
curlie
direnv
2024-08-18 19:31:22 +02:00
diskonaut
doggo
2024-09-24 23:55:02 +02:00
duf
2024-08-18 19:31:22 +02:00
dust
2024-09-24 23:55:02 +02:00
eza
fd
2024-08-18 19:31:22 +02:00
glow
gum
2024-09-24 23:55:02 +02:00
httpie
2024-08-18 19:31:22 +02:00
hyfetch
hyperfine
2024-09-24 23:55:02 +02:00
jq
2024-08-18 19:31:22 +02:00
just
2024-09-05 23:43:58 +02:00
nixfmt-rfc-style
2024-09-24 23:55:02 +02:00
ripgrep
2024-08-18 19:31:22 +02:00
starship
2024-09-24 23:55:02 +02:00
tealdeer
2024-09-27 03:13:27 +02:00
trash-cli
2024-08-18 19:31:22 +02:00
vivid
wthrr
2024-09-10 04:34:01 +02:00
yazi
2024-08-18 19:31:22 +02:00
zellij
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
2024-09-24 23:55:02 +02:00
".justfile".source = confs/justfile;
".zshrc.d".source = confs/zshrc.d;
".doom.d/config.el".source = doom.d/config.el;
".doom.d/init.el".source = doom.d/init.el;
".doom.d/packages.el".source = doom.d/packages.el;
};
## PROGRAMS
# bat config
home.activation.buildBatCache = "${lib.getExe pkgs.bat} cache --build";
programs.bat = {
enable = true;
config.theme = "Catppuccin-mocha";
themes = {
Catppuccin-mocha = {
src = pkgs.fetchFromGitHub {
2024-09-27 03:13:27 +02:00
owner = "catppuccin";
repo = "bat";
rev = "d3feec47b16a8e99eabb34cdfbaa115541d374fc";
sha256 = "sha256-s0CHTihXlBMCKmbBBb8dUhfgOOQu9PBCQ+uviy7o47w=";
2024-09-24 23:55:02 +02:00
};
file = "/themes/Catppuccin Mocha.tmTheme";
};
};
};
2024-09-27 03:13:27 +02:00
# fzf config
programs.fzf = {
enable = true;
colors = {
"bg+" = "#302D41";
bg = "#1E1E2E";
spinner = "#F8BD96";
hl = "#F28FAD";
fg = "#D9E0EE";
header = "#F28FAD";
info = "#DDB6F2";
pointer = "#F8BD96";
marker = "#F8BD96";
"fg+" = "#F2CDCD";
prompt = "#DDB6F2";
"hl+" = "#F28FAD";
};
defaultCommand = "fd --type f --hidden --follow --exclude .git";
};
2024-09-24 23:55:02 +02:00
# starship.rs
programs.starship = {
enable = true;
settings = lib.importTOML confs/starship.toml;
};
2024-09-27 02:11:32 +02:00
# zsh config
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
autocd = false;
envExtra = ''
export PATH="$HOME/bin:$HOME/.local/bin:/usr/sbin:$PATH"
2024-09-27 03:13:27 +02:00
eval "$(starship init zsh)"
2024-09-27 02:11:32 +02:00
'';
history = {
extended = true;
ignoreAllDups = false;
ignoreDups = true;
path = "${config.home.homeDirectory}/.zsh_history";
save = 65536;
share = false;
size = 100000;
};
historySubstringSearch.enable = true;
zplug.enable = true;
zplug.plugins = [
{
name = "zsh-users/zsh-syntax-highlighting";
tags = [ "defer:2" ];
}
{
name = "plugins/sudo";
tags = [ "from:oh-my-zsh" ];
}
{
name = "plugins/extract";
tags = [ "from:oh-my-zsh" ];
}
{
name = "plugins/systemd";
tags = [ "from:oh-my-zsh" ];
}
{
name = "${config.home.homeDirectory}/.zshrc.d";
2024-09-27 03:13:27 +02:00
tags = [
"from:local"
"use:'*'"
];
2024-09-27 02:11:32 +02:00
}
];
shellAliases = {
2024-09-27 03:13:27 +02:00
dnfi = "sudo dnf install $@";
dnfs = "sudo dnf search $@";
dnfu = "sudo dnf update $@";
dnfr = "sudo dnf remove $@";
2024-09-27 02:11:32 +02:00
ls = "eza --git --icons $@";
la = "eza --git --icons -a $@";
lal = "eza --git --icons -al $@";
ll = "eza --git --icons -l $@";
2024-09-27 03:13:27 +02:00
grep = "grep --color=auto";
2024-09-27 02:11:32 +02:00
df = "duf $@";
cp = "cp -i $@";
rm = "trash $@";
del = "/bin/rm -i $@";
mv = "mv -i $@";
zfun = "functions | bat -l zsh";
pubip4 = "curl -s -m 5 ipv4.icanhazip.com";
pubip6 = "curl -s -m 5 ipv6.icanhazip.com";
netcons = "lsof -i";
tulp = "ss -tulp";
openports = "sudo lsof -i | grep LISTEN";
pong = "ping -c 3 www.google.com";
lsock = "sudo lsof -i -P";
lsocku = "sudo lsof -nP | grep UDP";
lsockt = "sudo lsof -nP | grep TCP";
fw = "sudo firewall-cmd $@";
fwr = "sudo firewall-cmd --reload";
fwp = "sudo firewall-cmd --permanent $@";
ga = "git add $@";
gcl = "git clone $@";
gcmsg = "git commit -m $@";
gd = "git diff";
gp = "git push $@";
grm = "git rm $@";
grv = "git remote -v";
gst = "git status";
doomdoc = "\${xdg.configHome}/emacs/bin/doom doctor";
dsync = "\${xdg.configHome}/emacs/bin/doom sync";
dclean = "\${xdg.configHome}/emacs/bin/doom clean";
dgc = "\${xdg.configHome}/emacs/bin/doom gc";
dupgrade = "\${xdg.configHome}/emacs/bin/doom upgrade";
};
shellGlobalAliases = {
G = "| grep";
J = "| jq";
CC = "| wl-copy";
H = "| head";
T = "| tail";
L = "| less -RFX";
C = "| wc -l";
B = "| bat";
};
sessionVariables = {
PAGER = "less -RFX";
MANWIDTH = "88";
MANROFFOPT = "-c";
MANPAGER = "less -RFX";
EDITOR = "emacsclient";
GROFF_NO_SGR = 1;
BAT_PAGER = "less -RFX";
BAT_STYLE = "plain";
};
initExtraFirst = ''
export LS_COLORS=$(vivid generate catppuccin-mocha)
export LESS_TERMCAP_mb=$'\e[1;31m'
export LESS_TERMCAP_md=$'\e[1;34m'
export LESS_TERMCAP_so=$'\e[01;0;33m'
export LESS_TERMCAP_us=$'\e[01;31m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_ue=$'\e[0m'
if test -x ${config.home.homeDirectory}/bin/gumssh; then bindkey -s '^[s' 'gumssh^M'; fi
bindkey -s '^[f' 'yazi^M'
'';
};
2024-09-24 23:55:02 +02:00
# neovim
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
vim-startify
vim-lastplace
nerdcommenter
catppuccin-nvim
];
extraConfig = ''
set nocompatible
set showmatch
set ignorecase
set mouse=v
set hlsearch
set incsearch
set tabstop=4
set softtabstop=4
set expandtab
set shiftwidth=4
set autoindent
set relativenumber
set wildmode=longest,list
set cc=80
filetype plugin indent on
syntax on
set clipboard=unnamedplus
filetype plugin on
set cursorline
set ttyfast
colorscheme catppuccin
'';
};
# zellij config
programs.zellij.enable = true;
programs.zellij.settings = {
theme = "catppuccin-mocha";
themes = {
catppuccin-mocha = {
bg = "#585b70";
fg = "#cdd6f4";
red = "#f38ba8";
green = "#a6e3a1";
blue = "#89b4fa";
yellow = "#f9e2af";
magenta = "#f5c2e7";
orange = "#fab387";
cyan = "#89dceb";
black = "#181825";
white = "#cdd6f4";
};
};
copy_command = "wl-copy";
copy_clipboard = "system";
copy_on_select = true;
2024-08-18 19:31:22 +02:00
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
2024-09-24 23:55:02 +02:00
# XDG user dirs
xdg.userDirs = {
enable = true;
createDirectories = true;
download = "${config.home.homeDirectory}/downloads";
desktop = "${config.home.homeDirectory}/desktop";
documents = "${config.home.homeDirectory}/shared/documents";
publicShare = "${config.home.homeDirectory}/shared";
templates = null;
music = null;
pictures = "${config.home.homeDirectory}/shared/pictures";
videos = null;
};
2024-08-18 19:31:22 +02:00
# git config
programs.git = {
enable = true;
diff-so-fancy = {
enable = true;
2024-09-05 23:43:58 +02:00
pagerOpts = [
"--tabs=4"
"-RFX"
];
2024-08-18 19:31:22 +02:00
};
userName = "Jeffrey Serio";
userEmail = "hyperreal@moonshadow.dev";
extraConfig = {
core = {
editor = "emacsclient";
};
init = {
defaultBranch = "main";
};
pull = {
rebase = true;
};
};
};
# ssh config
programs.ssh.enable = true;
programs.ssh.matchBlocks = {
2024-09-10 04:34:01 +02:00
"auxnc-8g" = {
2024-09-16 03:40:04 +02:00
hostname = "152.53.39.153";
2024-08-18 19:31:22 +02:00
user = "jas";
};
2024-09-10 04:34:01 +02:00
"auxnc-96g" = {
hostname = "auxnc-96g.lyrebird-marlin.ts.net";
2024-09-05 23:43:58 +02:00
user = "jas";
2024-08-18 19:31:22 +02:00
};
2024-08-28 21:35:12 +02:00
"bttracker.nirn.quest" = {
hostname = "bttracker.nirn.quest";
user = "jas";
2024-09-10 04:34:01 +02:00
};
2024-08-28 21:35:12 +02:00
"hyperreal.coffee" = {
hostname = "hyperreal.coffee";
2024-08-18 19:31:22 +02:00
user = "jas";
};
2024-09-24 23:55:02 +02:00
"nas" = {
hostname = "nas.lyrebird-marlin.ts.net";
2024-08-18 19:31:22 +02:00
user = "jas";
};
2024-08-28 21:35:12 +02:00
};
2024-08-29 20:17:36 +02:00
# direnv
2024-08-28 21:35:12 +02:00
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
2024-08-18 19:31:22 +02:00
};
}