Files
nixos-config/home-manager/commands/commands.nix
2026-03-10 10:36:59 -07:00

267 lines
5.0 KiB
Nix

{
pkgs,
pkgs-unstable,
lib,
hostname,
hostTypes,
...
}:
let
list-keybinds = pkgs.writeShellScriptBin "list-keybinds" ''
hyprctl binds -j | ${pkgs.jq}/bin/jq -r '.[] |
select(.dispatcher != "") |
"[\(.modmask_str // "NONE")] + \(.key) \(.dispatcher) \(.arg // "")"
' | ${pkgs.rofi}/bin/rofi -dmenu \
-i \
-p "Keybinds" \
-theme-str 'window {width: 60%;}'
'';
in
{
imports = [
./direnv.nix
# ./custom/custom.nix
./eza.nix
./fastfetch/fastfetch.nix
./git.nix
./newsboat.nix
./nixvim/default.nix
./starship.nix
./tmux.nix
./zsh.nix
];
home.packages = with pkgs; [
# Common packages for all systems
age
age-plugin-1p
age-plugin-yubikey
agedu
b3sum
bandwhich
bat
basalt
btop
cpufetch
cpuid
cpu-x
curl
dig
docker
dust
fd
file
findutils
fosrl-olm
fzf
git
git-filter-repo
glances
gping
graphviz
jq
kitty
kopia
lazydocker
lazygit
lazyjournal
manga-tui
mcat
netop
nettools
nix-du
nix-prefetch-github
nmap
openssh
openssl
ptunnel
ripgrep
s3cmd
timg
tldr
trippy
trivy
tuptime
unzip
wget
wireguard-tools
yazi
yt-dlp
zstd
list-keybinds
]
# Desktop-specific packages (Linux desktops and macOS)
++ lib.optionals (!(hostTypes.isServer hostname)) (with pkgs; [
claude-code
caligula
ocamlPackages.utop
opencode
openconnect
yubikey-manager
])
# Server-specific packages
++ lib.optionals (hostTypes.isServer hostname) (with pkgs; [
gparted
parted
plocate
tailscale
tlp
traceroute
ffmpeg-full
pkgs-unstable.witr
])
# Linux desktop packages
++ lib.optionals (hostTypes.isLinuxDesktop hostname) (with pkgs; [
plocate
tlp
swaynotificationcenter
gparted
nerd-fonts.jetbrains-mono
nerd-fonts.hack
nerd-fonts.fira-code
dejavu_fonts
])
# Pentesting/security tools (eva-01 and eva-03)
++ lib.optionals (builtins.elem hostname [ "eva-01" "eva-03" ]) (with pkgs; [
aircrack-ng
hcxdumptool
hcxtools
metasploit
wifite2
wirelesstools
amass
bettercap
bloodhound
bully
burpsuite
cowpatty
crunch
dirbuster
dnschef
ffuf
hash-identifier
hashcat
hashcat-utils
hping
macchanger
medusa
netdiscover
netexec
pwnat
pwncat
reaverwps-t6x
recon-ng
rustscan
sqlmap
steghide
thc-hydra
])
# eva-01 specific
++ lib.optionals (hostname == "eva-01") [
pkgs.rpi-imager
pkgs.libusb1
pkgs.parted
pkgs.traceroute
pkgs.android-tools
pkgs.goose-cli
]
# eva-03 specific
++ lib.optionals (hostname == "eva-03") [
pkgs.parted
pkgs.traceroute
pkgs.ffmpeg-full
pkgs-unstable.vscode
(pkgs-unstable.llama-cpp.override { cudaSupport = true; })
pkgs-unstable.witr
]
# buildbox specific
++ lib.optionals (hostname == "buildbox") [
pkgs.parted
pkgs.traceroute
pkgs.ffmpeg-full
pkgs-unstable.witr
]
# ender-ml specific
++ lib.optionals (hostname == "ender-ml") [
pkgs-unstable.stable-diffusion-cpp-cuda
(pkgs-unstable.llama-cpp.override { cudaSupport = true; })
pkgs-unstable.witr
pkgs-unstable.comfy-ui-cuda
]
# acheron specific
++ lib.optionals (hostname == "acheron") [
pkgs.pkgs-unstable.witr
]
# eva-02 (macOS) specific
++ lib.optionals (hostname == "eva-02") [
pkgs-unstable.vscode
];
programs = {
ssh = {
enable = true;
enableDefaultConfig = false;
matchBlocks = {
"*" = {
setEnv = {
TERM = "xterm-256color";
};
forwardAgent = false;
forwardX11 = false;
serverAliveInterval = 0;
serverAliveCountMax = 3;
};
} // lib.optionalAttrs (hostname == "buildbox") {
"192.168.8.109" = {
identityFile = "~/.ssh/gitea-buildbox";
user = "gitea";
};
"gitea.miguelmuniz.com" = {
identityFile = "~/.ssh/gitea-buildbox";
user = "gitea";
};
"github.com" = {
identityFile = "~/.ssh/github-buildbox";
user = "git";
};
} // lib.optionalAttrs (hostname == "ender-ml") {
"192.168.8.109" = {
identityFile = "~/.ssh/gitea-ender-ml";
user = "gitea";
};
"gitea.miguelmuniz.com" = {
identityFile = "~/.ssh/gitea-ender-ml";
user = "gitea";
};
"github.com" = {
identityFile = "~/.ssh/github-ender-ml";
user = "git";
};
};
extraConfig = if hostname == "eva-02"
then ''
IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
''
else ''
IdentityAgent ~/.1password/agent.sock
'';
};
zoxide = {
enable = true;
enableZshIntegration = true;
};
};
}