move ssh out to its own file and add zsh

This commit is contained in:
2025-10-15 22:58:39 -05:00
parent 26401360d8
commit 89b6380859
6 changed files with 189 additions and 42 deletions

View File

@@ -0,0 +1,28 @@
{
pkgs,
config,
...
}: {
programs.ssh = {
enable = true;
matchBlocks = {
"git.blakedheld.xyz" = {
user = "gitea";
identityFile = "~/.ssh/id_snowbelle";
};
"git.snowbelle.lan" = {
user = "gitea";
identityFile = "~/.ssh/id_snowbelle";
};
"bebe" = {
hostname = "10.10.0.1";
user = "root";
identityFile = "~/.ssh/id_snowbelle";
};
};
};
# import sshkeys from keyring
home.file.".ssh/id_snowbelle".source = config.lib.file.mkOutOfStoreSymlink /home/blake/.nix/.keyring/ssh/id_snowbelle;
home.file.".ssh/id_snowbelle.pub".source = config.lib.file.mkOutOfStoreSymlink /home/blake/.nix/.keyring/ssh/id_snowbelle.pub;
}

View File

@@ -6,8 +6,6 @@
...
}:
{
imports = [
inputs.stylix.homeManagerModules.default
];
imports = [inputs.stylix.homeManagerModules.default];
}

View File

@@ -3,20 +3,18 @@
config,
...
}: {
home.packages = with pkgs; [ xdg-ninja ];
home.packages = with pkgs; [xdg-ninja];
xdg = {
enable = true;
configHome = "${config.home.homeDirectory}/.config";
cacheHome = "${config.home.homeDirectory}/.cache";
dataHome = "${config.home.homeDirectory}/.local/share";
stateHome = "${config.home.homeDirectory}/.local/state";
userDirs = { # ~/.config/user-dirs.dirs
enable = true;
# You can override defaults here:
userDirs = {
enable = true;
# writes ~/.config/user-dirs.dirs
desktop = "${config.home.homeDirectory}/desktop";
download = "${config.home.homeDirectory}/downloads";
documents = "${config.home.homeDirectory}/documents";
@@ -28,5 +26,10 @@
};
};
# misc env variables to get things out of ~ (<3 xdg-ninja)
home.sessionVariables = {
GOPATH="$XDG_DATA_HOME/go";
_JAVA_OPTIONS="-Djava.util.prefs.userRoot=""$XDG_CONFIG_HOME""/java";
};
}

View File

@@ -3,6 +3,140 @@
config,
...
}: {
# export some defaults
home.sessionVariables = {
EDITOR = "nvim";
PAGER = "less";
};
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
autocd = true;
enableCompletion = true;
autosuggestion = {
enable = true;
highlight = "fg=#ff00ff,bg=cyan,bold,underline";
};
syntaxHighlighting = {
enable = true;
highlighters = ["main" "brackets" "pattern" "regexp" "cursor" "root"];
styles = {
"default" = "none";
"unknown-token" = "fg=yellow,bold";
"reserved-word" = "fg=blue,bold";
"alias" = "fg=magenta";
"suffix-alias" = "fg=magenta";
"builtin" = "fg=cyan";
"function" = "fg=cyan";
"command" = "fg=white,bold";
"precommand" = "fg=cyan,underline";
"commandseparator" = "fg=white";
"hashed-command" = "fg=blue";
"path" = "fg=white,underline";
"globbing" = "fg=magenta";
"history-expansion" = "fg=yellow";
"single-hyphen-option" = "fg=blue";
"double-hyphen-option" = "fg=blue";
"back-quoted-argument" = "fg=yellow";
"single-quoted-argument" = "fg=white";
"double-quoted-argument" = "fg=white";
"dollar-double-quoted-argument" = "fg=cyan";
"back-double-quoted-argument" = "fg=cyan";
};
};
history = {
size = 10000;
save = 10000;
share = true;
append = true;
extended = true;
path = "$XDG_STATE_HOME/zsh/history";
};
shellAilses = {
# --- zsh ---
cfz = "nvim $HOME/.config/zsh/.zshrc";
src = "source $HOME/.config/zsh/.zshrc";
# --- config editing ---
cfh = "nvim $HOME/.config/hypr/hyprland.conf";
cfl = "nvim $HOME/.config/lf/lfrc";
# --- navigation ---
ls = "ls --color=auto --group-directories-first";
ll = "ls -lh --color=auto --group-directories-first";
la = "ls -Alh --color=auto --group-directories-first";
".." = "cd ..";
"..." = "cd ../..";
fs = "du -h | sort -h";
ds = "du -hs";
# --- shortcuts ---
vswap = "cd ~/.local/state/nvim/swap";
rswap = "rm ~/.local/state/nvim/swap/*";
v = "nvim";
sv = "sudo nvim";
vim = "nvim";
# --- safety ---
cp = "cp -iv";
mv = "mv -iv";
rm = "rm -Iv";
# --- colors ---
grep = "grep --color=auto";
fgrep = "fgrep --color=auto";
egrep = "egrep --color=auto";
# --- scripts ---
rebuild = "sh ~/.nix/bin/rebuild.sh";
perms = "sudo sh ~/.nix/bin/perms.sh";
bb = "sudo sh ~/.nix/bin/backup_browse.sh";
# --- git ---
status = "git status";
add = "git add";
commit = "git commit -am";
push = "git push";
pull = "git pull";
dotfiles = "/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME";
dtf = "/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME";
# --- systemd ---
stat = "sudo systemctl status";
restart = "sudo systemctl restart";
start = "sudo systemctl start";
stop = "sudo systemctl stop";
jou = "sudo journalctl -xeu";
live = "sudo journalctl -o short-iso -n 50 -fu";
# --- system ---
peace = "systemctl poweroff";
love = "systemctl reboot";
lock = "loginctl lock-session";
};
initContent = ''
# the prompt
PS1='%F{0}%K{126}%B[%n@%m]%b%k%f:%F{015}%B[%~]%b%f%F{015}%S$%s%f '
# lf changes working dir on exit
alias lf='lfcd'
lfcd () {cd "$(command lf -print-last-dir "$@")"}
'';
# zplug = {
# enable = true;
# zplugHome = "$XDG_STATE_HOME/zsh/zplug";
# plugins = [
# {name = "zsh-users/zsh-syntax-highlighting";}
# ];
# };
};
}

View File

@@ -8,6 +8,8 @@
imports = [
./dots/neovim
./dots/lf
./dots/zsh
./dots/ssh
./dots/git
./dots/xdg
];
@@ -28,45 +30,27 @@
];
# setup zsh
home.sessionVariables.ZDOTDIR = "$HOME/.config/zsh";
programs.zsh = {
enable = true;
# dotDir = ".config/zsh";
};
# link dotfiles
xdg.configFile."zsh" = {
source = config.lib.file.mkOutOfStoreSymlink "/home/blake/.nix/users/blake/dotfiles/zsh";
recursive = true;
};
#home.sessionVariables.ZDOTDIR = "$HOME/.config/zsh";
#programs.zsh = {
# enable = true;
# # dotDir = ".config/zsh";
#};
## link dotfiles
#xdg.configFile."zsh" = {
# source = config.lib.file.mkOutOfStoreSymlink "/home/blake/.nix/users/blake/dotfiles/zsh";
# recursive = true;
#};
programs.gpg = {
enable = true;
};
services.gpg-agent = {
enable = true;
enableSshSupport = true;
#pinentry.package = pkgs.pinentry-qt;
#pinentry.program = "pinentry-qt";
};
programs.ssh = {
enable = true;
matchBlocks = {
"git.blakedheld.xyz" = {
user = "gitea";
identityFile = "~/.ssh/id_snowbelle";
};
"git.snowbelle.lan" = {
user = "gitea";
identityFile = "~/.ssh/id_snowbelle";
};
"dockers" = {
hostname = "10.10.0.30";
user = "blake";
identityFile = "~/.ssh/id_snowbelle";
};
};
};
# import sshkeys from keyring
home.file.".ssh/id_snowbelle".source = config.lib.file.mkOutOfStoreSymlink /home/blake/.nix/.keyring/ssh/id_snowbelle;
home.file.".ssh/id_snowbelle.pub".source = config.lib.file.mkOutOfStoreSymlink /home/blake/.nix/.keyring/ssh/id_snowbelle.pub;
#home.packages with pkgs; = [pinentry-qt pinentry_mac];
# # manage secrets with sops
# sops.secrets = {