2026-01-16 19:54:10 -08:00
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
inputs,
|
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
2026-02-27 22:22:30 -08:00
|
|
|
pkgs-unstable,
|
2026-01-16 19:54:10 -08:00
|
|
|
ssh-agent-switcher,
|
|
|
|
|
user,
|
|
|
|
|
...
|
|
|
|
|
} :
|
|
|
|
|
let
|
|
|
|
|
pathToKeys = ../common/keys/yubi;
|
|
|
|
|
yubiKeys =
|
|
|
|
|
lib.lists.forEach (builtins.attrNames (builtins.readDir pathToKeys))
|
|
|
|
|
(key: lib.substring 0 (lib.stringLength key - lib.stringLength ".pub") key); # Remove .pub suffix.
|
|
|
|
|
yubikeyPublicKeyEntries = lib.attrsets.mergeAttrsList (
|
|
|
|
|
lib.lists.map
|
|
|
|
|
(key: { ".ssh/${key}.pub".source = "${pathToKeys}/${key}.pub"; })
|
|
|
|
|
yubiKeys
|
|
|
|
|
);
|
|
|
|
|
username = user.name;
|
|
|
|
|
homeDirectory = user.homeDirectory;
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
|
../../home-modules/hyprland
|
|
|
|
|
|
|
|
|
|
../../home-modules
|
|
|
|
|
../../home-modules/direnv.nix
|
|
|
|
|
../../home-modules/ghostty-config.nix
|
|
|
|
|
../../home-modules/git.nix
|
|
|
|
|
../../home-modules/lazygit.nix
|
|
|
|
|
../../home-modules/nvim.nix
|
|
|
|
|
../../home-modules/sops.nix
|
|
|
|
|
# ../../home-modules/ssh-client.nix
|
|
|
|
|
../../home-modules/starship.nix
|
|
|
|
|
../../home-modules/tmux.nix
|
|
|
|
|
../../home-modules/zsh.nix
|
2026-01-18 02:39:25 -08:00
|
|
|
|
|
|
|
|
inputs.zen-browser.homeModules.beta
|
2026-01-16 19:54:10 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Custom options for my packages.
|
|
|
|
|
nvim = {
|
2026-02-27 22:22:30 -08:00
|
|
|
package = pkgs-unstable.neovim;
|
2026-01-16 19:54:10 -08:00
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
ghostty = {
|
|
|
|
|
font-size = "14";
|
|
|
|
|
window-decoration = false;
|
|
|
|
|
};
|
2026-01-18 02:39:25 -08:00
|
|
|
programs.zen-browser.enable = true;
|
2026-01-16 19:54:10 -08:00
|
|
|
|
|
|
|
|
home = {
|
|
|
|
|
username = username;
|
|
|
|
|
homeDirectory = homeDirectory;
|
|
|
|
|
|
|
|
|
|
packages = with pkgs; [
|
|
|
|
|
# Media
|
|
|
|
|
loupe
|
|
|
|
|
vlc
|
|
|
|
|
bluetui
|
|
|
|
|
# Audio
|
|
|
|
|
wireplumber
|
|
|
|
|
spotify-player
|
|
|
|
|
# Secret management.
|
|
|
|
|
age
|
|
|
|
|
sops
|
|
|
|
|
# Browsers
|
|
|
|
|
firefox
|
|
|
|
|
# Coms
|
|
|
|
|
discord
|
2026-01-20 15:27:07 -08:00
|
|
|
slack
|
2026-01-16 19:54:10 -08:00
|
|
|
obs-studio
|
|
|
|
|
|
|
|
|
|
# AWS tools
|
|
|
|
|
# awscli2
|
|
|
|
|
# (callPackage ../../nixos-modules/shell-apps/aws-cli-mfa.nix {})
|
|
|
|
|
|
2026-01-20 15:27:07 -08:00
|
|
|
# Minecraft
|
|
|
|
|
prismlauncher
|
|
|
|
|
|
2026-01-16 19:54:10 -08:00
|
|
|
# Misc
|
2026-02-27 22:22:30 -08:00
|
|
|
pkgs-unstable.opencode
|
|
|
|
|
pkgs-unstable.claude-code
|
|
|
|
|
pkgs-unstable.openssl
|
2026-03-01 16:14:55 -08:00
|
|
|
pkgs-unstable.dig
|
2026-01-16 19:54:10 -08:00
|
|
|
# zig
|
|
|
|
|
fastfetch
|
|
|
|
|
fzf
|
|
|
|
|
ripgrep
|
|
|
|
|
git
|
|
|
|
|
wget
|
|
|
|
|
exercism
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
file = {} // yubikeyPublicKeyEntries;
|
|
|
|
|
|
|
|
|
|
pointerCursor = {
|
|
|
|
|
gtk.enable = true;
|
|
|
|
|
x11.enable = true;
|
|
|
|
|
hyprcursor.enable = true;
|
|
|
|
|
name = "Posy_Cursor_Black";
|
|
|
|
|
package = pkgs."posy-cursors";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
stateVersion = "25.11";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# home.activation.aws-cli-mfa-config = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
|
|
|
|
# mkdir -p ~/.config/aws-cli-mfa
|
|
|
|
|
# cat > ~/.config/aws-cli-mfa/config.yaml << EOF
|
2026-03-01 13:49:02 -08:00
|
|
|
# mfa_serial: $(cat ${config.sops.secrets."aws/jmug_matcha_mfa_serial".path})
|
|
|
|
|
# role_arn: $(cat ${config.sops.secrets."aws/role_arn".path})
|
|
|
|
|
# session_duration: 43200
|
|
|
|
|
# EOF
|
2026-01-16 19:54:10 -08:00
|
|
|
# '';
|
|
|
|
|
|
|
|
|
|
programs.zsh = {
|
|
|
|
|
shellAliases = {
|
2026-03-01 13:49:24 -08:00
|
|
|
flakeconf = "nvim ${homeDirectory}/nixos/flake.nix";
|
|
|
|
|
nosconf = "nvim ${homeDirectory}/nixos/hosts/nixbox/configuration.nix";
|
|
|
|
|
homeconf = "nvim ${homeDirectory}/nixos/hosts/nixbox/home.nix";
|
|
|
|
|
nvconf = "sudo nvim ${homeDirectory}/nixos/home-modules/explicit-configs/nvim/init.lua";
|
2026-01-16 19:54:10 -08:00
|
|
|
rshellconf = "source ~/.zshrc";
|
|
|
|
|
# TODO: Interpolate the name of the host here.
|
|
|
|
|
nrsw = "sudo nixos-rebuild switch --flake ${homeDirectory}/nixos#nixbox";
|
|
|
|
|
fly = "flyctl";
|
|
|
|
|
# awsmfa = "eval $(aws-cli-mfa)";
|
|
|
|
|
# uawsmfa = "eval $(aws-cli-mfa --unset)";
|
|
|
|
|
};
|
|
|
|
|
loginExtra = ''
|
|
|
|
|
if [ ! -e "/tmp/ssh-agent.''${USER}" ]; then
|
|
|
|
|
if [ -n "''${ZSH_VERSION}" ]; then
|
|
|
|
|
eval ${ssh-agent-switcher.packages.x86_64-linux.default}/bin/ssh-agent-switcher 2>/dev/null "&!"
|
|
|
|
|
else
|
|
|
|
|
${ssh-agent-switcher.packages.x86_64-linux.default}/bin/ssh-agent-switcher 2>/dev/null &
|
|
|
|
|
disown 2>/dev/null || true
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
export SSH_AUTH_SOCK="/tmp/ssh-agent.''${USER}"
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.ssh-agent.enable = true;
|
|
|
|
|
programs.ssh = {
|
|
|
|
|
enable = true;
|
2026-03-01 13:48:50 -08:00
|
|
|
enableDefaultConfig = false;
|
2026-01-16 19:54:10 -08:00
|
|
|
matchBlocks = {
|
|
|
|
|
"git" = {
|
|
|
|
|
host = "github.com";
|
|
|
|
|
user = "git";
|
|
|
|
|
identityFile = [
|
|
|
|
|
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
|
|
|
|
|
"/home/jmug/.ssh/id_jmug" # Fallback key with passphrase.
|
|
|
|
|
];
|
2026-03-01 13:48:50 -08:00
|
|
|
addKeysToAgent = "yes";
|
2026-01-16 19:54:10 -08:00
|
|
|
};
|
|
|
|
|
"forgejo" = {
|
|
|
|
|
host = "code.jmug.me";
|
|
|
|
|
user = "forgejo";
|
|
|
|
|
identityFile = [
|
|
|
|
|
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
|
|
|
|
|
"/home/jmug/.ssh/id_jmug" # Fallback key with passphrase.
|
|
|
|
|
];
|
2026-03-01 13:48:50 -08:00
|
|
|
addKeysToAgent = "yes";
|
2026-01-16 19:54:10 -08:00
|
|
|
};
|
2026-03-01 16:15:15 -08:00
|
|
|
"homeserver" = {
|
2026-01-21 21:02:18 -08:00
|
|
|
user = "jmug";
|
|
|
|
|
hostname = "100.122.244.59";
|
|
|
|
|
identityFile = [
|
|
|
|
|
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
|
|
|
|
|
"/home/jmug/.ssh/id_jmug" # Fallback key with passphrase.
|
|
|
|
|
];
|
2026-03-01 16:15:15 -08:00
|
|
|
forwardAgent = true;
|
|
|
|
|
addKeysToAgent = "yes";
|
|
|
|
|
};
|
|
|
|
|
"racknerd" = {
|
|
|
|
|
user = "jmug";
|
|
|
|
|
hostname = "155.94.155.137";
|
|
|
|
|
identityFile = [
|
|
|
|
|
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
|
|
|
|
|
"/home/jmug/.ssh/id_jmug" # Fallback key with passphrase.
|
|
|
|
|
];
|
2026-03-01 13:48:50 -08:00
|
|
|
addKeysToAgent = "yes";
|
2026-01-21 21:02:18 -08:00
|
|
|
};
|
2026-01-16 19:54:10 -08:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Let Home Manager install and manage itself.
|
|
|
|
|
programs.home-manager.enable = true;
|
|
|
|
|
}
|