updated nvim config, added local_ai

This commit is contained in:
2026-08-16 10:16:13 -07:00
parent 35cf83cb70
commit da513216a3
17 changed files with 734 additions and 321 deletions

75
flake.lock generated
View File

@@ -20,6 +20,25 @@
"type": "github"
}
},
"comfy-ui": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1786714237,
"narHash": "sha256-XnXKBpaidykfCegAqBGI7/F61IFtMSKUibQct/dP2Zw=",
"owner": "utensils",
"repo": "comfyui-nix",
"rev": "4501c5fe8dd93530d856866ba8bc4b585b508d41",
"type": "github"
},
"original": {
"owner": "utensils",
"repo": "comfyui-nix",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
@@ -40,6 +59,24 @@
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1767609335,
"narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "250481aafeb741edfe23d29195671c19b36b6dca",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -63,7 +100,7 @@
},
"nixos-hardware": {
"inputs": {
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1786717298,
@@ -81,6 +118,37 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1765674936,
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1767892417,
"narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
@@ -93,7 +161,7 @@
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1786711500,
"narHash": "sha256-QvnceIGTBeDvDd9oCn+GvdsnkquliuwbVgpiRH68qaQ=",
@@ -112,10 +180,11 @@
"root": {
"inputs": {
"antigravity": "antigravity",
"comfy-ui": "comfy-ui",
"disko": "disko",
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_3"
}
}
},

130
flake.nix
View File

@@ -1,59 +1,87 @@
{
description = "Multi-Machine NixOS Configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
description = "Multi-Machine NixOS Configuration";
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
antigravity = {
url = "github:Hy4ri/antigravity-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs:
let
system = "x86_64-linux";
commonModules = [
./modules/core
./modules/graphical
./modules/apps
inputs.home-manager.nixosModules.home-manager
{
nixpkgs.overlays = [
inputs.antigravity.overlays.default
];
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
backupFileExtension = "backup";
users.anish = import ./home;
};
}
];
in {
nixosConfigurations = {
hades = inputs.nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = commonModules ++ [
inputs.nixos-hardware.nixosModules.common-cpu-amd
./hosts/hades
];
};
};
antigravity = {
url = "github:Hy4ri/antigravity-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
comfy-ui = {
url = "github:utensils/comfyui-nix";
};
};
outputs =
inputs:
let
system = "x86_64-linux";
commonModules = [
./modules/core
./modules/graphical
./modules/apps
inputs.home-manager.nixosModules.home-manager
{
nixpkgs.overlays = [
inputs.antigravity.overlays.default
inputs.comfy-ui.overlays.default
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
backupFileExtension = "backup";
users.anish = import ./home;
};
}
];
in
{
nixosConfigurations = {
hades = inputs.nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = commonModules ++ [
inputs.nixos-hardware.nixosModules.common-cpu-amd
./hosts/hades
];
};
};
devShells.${system}.default =
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.antigravity.overlays.default ];
config.allowUnfree = true;
};
in
pkgs.mkShell {
packages = with pkgs; [
llvmPackages_latest.clang
llvmPackages_latest.lld
llvmPackages_latest.lldb
llvmPackages_latest.llvm
llvmPackages_latest.clang-tools
llvmPackages_latest.libcxx
rustup
uv
];
};
};
}

View File

@@ -6,6 +6,7 @@
./foot.nix
./brave.nix
./zsh.nix
./nvim
];
xdg.portal.config.common.default = "*";

View File

@@ -0,0 +1,2 @@
-- Bootstrap lazy.nvim, LazyVim and custom plugins
require("config.lazy")

View File

@@ -0,0 +1,5 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds set by LazyVim:
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Custom autocmds can be defined here

View File

@@ -0,0 +1,8 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps set by LazyVim:
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
local map = vim.keymap.set
-- Custom keymaps can be added below:
-- Example: map("n", "<leader>pv", vim.cmd.Ex, { desc = "Open file explorer" })

View File

@@ -0,0 +1,56 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
-- 1. Add LazyVim core and import its default plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- 2. Optional LazyVim Extras (uncomment or add extras as needed)
{ import = "lazyvim.plugins.extras.lang.nix" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.formatting.prettier" },
-- 3. Import user plugins from lua/plugins/*.lua
{ import = "plugins" },
},
defaults = {
-- Plugins load during startup unless explicitly marked lazy
lazy = false,
-- Always track latest git commit
version = false,
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true,
notify = false,
},
performance = {
rtp = {
paths = vim.env.NVIM_TREESITTER_PARSERS and { vim.env.NVIM_TREESITTER_PARSERS } or {},
disabled_plugins = {
"gzip",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View File

@@ -0,0 +1,17 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set by LazyVim:
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
local opt = vim.opt
-- Tab and indentation settings
opt.tabstop = 4
opt.shiftwidth = 4
opt.expandtab = true
-- Line numbers
opt.number = true
opt.relativenumber = true
-- Clipboard integration with system/Wayland
opt.clipboard = "unnamedplus"

View File

@@ -0,0 +1,24 @@
return {
-- Tokyo Night colorscheme configuration
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {
style = "night",
transparent = true,
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
},
-- Configure LazyVim to use tokyonight by default
{
"LazyVim/LazyVim",
opts = {
colorscheme = "tokyonight",
},
},
}

View File

@@ -0,0 +1,48 @@
-- User custom plugin configurations and overrides
return {
-- Disable Mason on NixOS (all LSPs/formatters/linters are managed declaratively via Nix)
{ "mason.nvim", enabled = false },
{ "mason-lspconfig.nvim", enabled = false },
{ "mason-nvim-dap.nvim", enabled = false },
-- Treesitter configuration tailored for NixOS
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- Nix provides all precompiled grammars in ~/.config/nvim/parser and rtp.
-- Clear LazyVim's default ensure_installed list to prevent compile triggers on startup.
opts.ensure_installed = {}
opts.auto_install = false
opts.sync_install = false
opts.highlight = {
enable = true,
additional_vim_regex_highlighting = false,
}
opts.indent = { enable = true }
end,
},
-- Example: Telescope / fzf configuration
{
"nvim-telescope/telescope.nvim",
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- Linting configuration (graceful fallback if linters are not yet in PATH)
{
"mfussenegger/nvim-lint",
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
if vim.fn.executable("statix") == 0 then
opts.linters_by_ft["nix"] = {}
end
end,
},
}

76
home/nvim/default.nix Normal file
View File

@@ -0,0 +1,76 @@
{ config, pkgs, lib, ... }:
let
treesitterParsers = pkgs.symlinkJoin {
name = "treesitter-parsers";
paths = builtins.attrValues pkgs.vimPlugins.nvim-treesitter.passthru.grammarPlugins;
};
in
{
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
withNodeJs = true;
withPython3 = true;
extraPackages = with pkgs; [
# Native compilation tools & Treesitter CLI
gcc
clang
gnumake
cmake
tree-sitter
# Search & Fuzzy Finding
ripgrep
fd
fzf
# Archive and Network Utilities
git
curl
unzip
gnutar
gzip
# Language Servers, Linters & Formatters (Declarative, no Mason needed)
# Nix
nil
nixfmt
statix
# Lua
lua-language-server
stylua
# C / C++
llvmPackages_latest.clang-tools
llvmPackages_latest.lldb
# Rust
rust-analyzer
# Python
pyright
ruff
# Web / TypeScript / JavaScript / HTML / CSS / JSON
vtsls
vscode-langservers-extracted
prettier
# Shell
shfmt
shellcheck
];
extraWrapperArgs = [
"--set" "NVIM_TREESITTER_PARSERS" "${treesitterParsers}"
];
};
# Symlink LazyVim configuration to ~/.config/nvim recursively
xdg.configFile."nvim" = {
source = ./config;
recursive = true;
};
# Symlink precompiled Treesitter parsers directly into ~/.config/nvim/parser
xdg.configFile."nvim/parser".source = "${treesitterParsers}/parser";
}

View File

@@ -1,207 +1,220 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
programs.bat = {
enable = true;
config = {
theme = "base16";
};
programs.bat = {
enable = true;
config = {
theme = "base16";
};
};
programs.lsd = {
enable = true;
enableZshIntegration = false; # We explicitly define custom aliases below
};
programs.lsd = {
enable = true;
enableZshIntegration = false; # We explicitly define custom aliases below
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
defaultOptions = [
"--color=dark"
"--color=fg:-1,bg:-1,hl:#c678dd,fg+:#ffffff,bg+:#4b5263,hl+:#d858fe"
"--color=info:#98c379,prompt:#61afef,pointer:#be5046,marker:#e5c07b,spinner:#61afef,header:#61afef"
];
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = [ "--cmd" "cd" ];
};
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting = {
enable = true;
highlighters = [ "main" "brackets" ];
};
oh-my-zsh = {
enable = true;
plugins = [
"git"
"tmux"
"battery"
"colored-man-pages"
"jsontools"
];
extraConfig = ''
COMPLETION_WAITING_DOTS="..."
ZVM_INIT_MODE="sourcing"
'';
};
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "fzf-tab";
src = pkgs.zsh-fzf-tab;
file = "share/fzf-tab/fzf-tab.plugin.zsh";
}
{
name = "zsh-interactive-cd";
src = pkgs.fetchFromGitHub {
owner = "changyuheng";
repo = "zsh-interactive-cd";
rev = "e7d4802aa526ec069dafec6709549f4344ce9d4a";
sha256 = "sha256-j23Ew18o7i/7dLlrTu0/54+6mbY8srsptfrDP/9BI/Q=";
};
file = "zsh-interactive-cd.plugin.zsh";
}
];
sessionVariables = {
EDITOR = "nvim";
BAT_THEME = "base16";
ZSH_TMUX_FIXTERM = "true";
GPG_TTY = "$(tty)";
PNPM_HOME = "$HOME/.local/share/pnpm";
};
shellAliases = {
vim = "nvim";
cat = "bat --paging=never";
ls = "lsd";
l = "ls -al";
clear = "clear -x";
rm = "rm -I";
zshconf = "$EDITOR $HOME/NixOS-Configs/home/zsh.nix";
hyprconf = "$EDITOR $HOME/NixOS-Configs/home/hypr/hyprland.nix";
setup = "source ./setup_env.sh";
gpuenv = "__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia";
digital = "$HOME/Tools/Digital/Digital.sh";
};
initContent = lib.mkMerge [
(lib.mkBefore ''
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
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
'')
(lib.mkAfter ''
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Path configuration
export PATH="$HOME/.local/bin:$HOME/bin:$HOME/.cargo/bin:$PNPM_HOME:$PATH"
if [ -d "$HOME/Tools/xilinx/Vivado/2023.1/bin" ]; then
export PATH="$HOME/Tools/xilinx/Vivado/2023.1/bin:$PATH"
fi
# Miniconda / conda profile hook if installed
if [ -f /opt/miniconda3/etc/profile.d/conda.sh ]; then
source /opt/miniconda3/etc/profile.d/conda.sh
fi
# Environment modules support if available
if (( ''${+functions[module]} )) || [ -f /etc/modules/init/zsh ]; then
[ -f /etc/modules/init/zsh ] && source /etc/modules/init/zsh
module use --append "$HOME/.config/modulefiles" 2>/dev/null || true
fi
# Auto-tmux configuration
use_auto_tmux () {
! ([ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] || $(pgrep -x "i3" > /dev/null || pgrep -x "sway" > /dev/null || pgrep -x "Hyprland" > /dev/null))
}
if use_auto_tmux; then
export ZSH_TMUX_AUTOSTART=true
export ZSH_TMUX_AUTOCONNECT=false
export ZSH_TMUX_AUTOQUIT=true
else
export ZSH_TMUX_AUTOSTART=false
export ZSH_TMUX_AUTOCONNECT=false
export ZSH_TMUX_AUTOQUIT=false
fi
if [[ -n "$TMUX" ]]; then
tmux-window-name() {
if [ -n "$TMUX_PLUGIN_MANAGER_PATH" ] && [ -f "$TMUX_PLUGIN_MANAGER_PATH/tmux-window-name/scripts/rename_session_windows.py" ]; then
("$TMUX_PLUGIN_MANAGER_PATH/tmux-window-name/scripts/rename_session_windows.py" &)
fi
}
autoload -Uz add-zsh-hook
add-zsh-hook chpwd tmux-window-name
fi
# Custom helper functions
perlmutter_pass () {
echo -n 'bw master password: '
read -s MASTER_PASS
echo
echo -n 'Copying passkey...'
echo "$(echo "$MASTER_PASS" | bw get password iris.nersc.gov 2>/dev/null)$(echo "$MASTER_PASS" | bw get totp iris.nersc.gov 2>/dev/null)" | wl-copy
echo 'Done.'
}
compiler_explorer () {
docker run -d -p 10240:10240 --name compiler-explorer madduci/docker-compiler-explorer
}
airplay_server () {
uxplay -p 10000 -nh -n "$(hostname)" -restrict -allow 88:66:5A:76:32:F5 -allow C4:AC:AA:76:B7:80
}
zathura_md () {
cat "$1" | pandoc -f markdown -t pdf | zathura -
}
fooocus () {
if [ -f "$HOME/Tools/Fooocus/entry_with_update.py" ]; then
"$HOME/.conda/envs/fooocus/bin/python" "$HOME/Tools/Fooocus/entry_with_update.py"
else
echo "Fooocus not found at $HOME/Tools/Fooocus"
fi
}
# Per-host / system local overrides fallback
if [ -f "$HOME/.config/zsh/$(hostname)/env.sh" ]; then
source "$HOME/.config/zsh/$(hostname)/env.sh"
elif [ -f "$HOME/.zshrc.local" ]; then
source "$HOME/.zshrc.local"
fi
# Fetch / Banner on interactive terminal start
if [[ -o interactive ]] && [ -z "$TMUX" ] && command -v pfetch >/dev/null 2>&1; then
pfetch
fi
'')
];
};
home.packages = with pkgs; [
pfetch-rs
bitwarden-cli
pandoc
zathura
tmux
programs.fzf = {
enable = true;
enableZshIntegration = true;
defaultOptions = [
"--color=dark"
"--color=fg:-1,bg:-1,hl:#c678dd,fg+:#ffffff,bg+:#4b5263,hl+:#d858fe"
"--color=info:#98c379,prompt:#61afef,pointer:#be5046,marker:#e5c07b,spinner:#61afef,header:#61afef"
];
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = [
"--cmd"
"cd"
];
};
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting = {
enable = true;
highlighters = [
"main"
"brackets"
];
};
oh-my-zsh = {
enable = true;
plugins = [
"git"
"tmux"
"battery"
"colored-man-pages"
"jsontools"
];
extraConfig = ''
COMPLETION_WAITING_DOTS="..."
ZVM_INIT_MODE="sourcing"
'';
};
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "fzf-tab";
src = pkgs.zsh-fzf-tab;
file = "share/fzf-tab/fzf-tab.plugin.zsh";
}
{
name = "zsh-interactive-cd";
src = pkgs.fetchFromGitHub {
owner = "changyuheng";
repo = "zsh-interactive-cd";
rev = "e7d4802aa526ec069dafec6709549f4344ce9d4a";
sha256 = "sha256-j23Ew18o7i/7dLlrTu0/54+6mbY8srsptfrDP/9BI/Q=";
};
file = "zsh-interactive-cd.plugin.zsh";
}
];
sessionVariables = {
EDITOR = "nvim";
BAT_THEME = "base16";
ZSH_TMUX_FIXTERM = "true";
GPG_TTY = "$(tty)";
PNPM_HOME = "$HOME/.local/share/pnpm";
};
shellAliases = {
vim = "nvim";
cat = "bat --paging=never";
ls = "lsd";
l = "ls -al";
clear = "clear -x";
rm = "rm -I";
zshconf = "$EDITOR $HOME/NixOS-Configs/home/zsh.nix";
hyprconf = "$EDITOR $HOME/NixOS-Configs/home/hypr/hyprland.nix";
setup = "source ./setup_env.sh";
gpuenv = "__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia";
digital = "$HOME/Tools/Digital/Digital.sh";
nixos_test = "sudo nixos_rebuild test --flake $HOME/NixOS-Configs#hades";
nixos_switch = "sudo nixos_rebuild switch --flake $HOME/NixOS-Configs#hades";
};
initContent = lib.mkMerge [
(lib.mkBefore ''
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
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
'')
(lib.mkAfter ''
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Path configuration
export PATH="$HOME/.local/bin:$HOME/bin:$HOME/.cargo/bin:$PNPM_HOME:$PATH"
if [ -d "$HOME/Tools/xilinx/Vivado/2023.1/bin" ]; then
export PATH="$HOME/Tools/xilinx/Vivado/2023.1/bin:$PATH"
fi
# Miniconda / conda profile hook if installed
if [ -f /opt/miniconda3/etc/profile.d/conda.sh ]; then
source /opt/miniconda3/etc/profile.d/conda.sh
fi
# Environment modules support if available
if (( ''${+functions[module]} )) || [ -f /etc/modules/init/zsh ]; then
[ -f /etc/modules/init/zsh ] && source /etc/modules/init/zsh
module use --append "$HOME/.config/modulefiles" 2>/dev/null || true
fi
# Auto-tmux configuration
use_auto_tmux () {
! ([ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] || $(pgrep -x "i3" > /dev/null || pgrep -x "sway" > /dev/null || pgrep -x "Hyprland" > /dev/null))
}
if use_auto_tmux; then
export ZSH_TMUX_AUTOSTART=true
export ZSH_TMUX_AUTOCONNECT=false
export ZSH_TMUX_AUTOQUIT=true
else
export ZSH_TMUX_AUTOSTART=false
export ZSH_TMUX_AUTOCONNECT=false
export ZSH_TMUX_AUTOQUIT=false
fi
if [[ -n "$TMUX" ]]; then
tmux-window-name() {
if [ -n "$TMUX_PLUGIN_MANAGER_PATH" ] && [ -f "$TMUX_PLUGIN_MANAGER_PATH/tmux-window-name/scripts/rename_session_windows.py" ]; then
("$TMUX_PLUGIN_MANAGER_PATH/tmux-window-name/scripts/rename_session_windows.py" &)
fi
}
autoload -Uz add-zsh-hook
add-zsh-hook chpwd tmux-window-name
fi
# Custom helper functions
perlmutter_pass () {
echo -n 'bw master password: '
read -s MASTER_PASS
echo
echo -n 'Copying passkey...'
echo "$(echo "$MASTER_PASS" | bw get password iris.nersc.gov 2>/dev/null)$(echo "$MASTER_PASS" | bw get totp iris.nersc.gov 2>/dev/null)" | wl-copy
echo 'Done.'
}
compiler_explorer () {
docker run -d -p 10240:10240 --name compiler-explorer madduci/docker-compiler-explorer
}
airplay_server () {
uxplay -p 10000 -nh -n "$(hostname)" -restrict -allow 88:66:5A:76:32:F5 -allow C4:AC:AA:76:B7:80
}
zathura_md () {
cat "$1" | pandoc -f markdown -t pdf | zathura -
}
fooocus () {
if [ -f "$HOME/Tools/Fooocus/entry_with_update.py" ]; then
"$HOME/.conda/envs/fooocus/bin/python" "$HOME/Tools/Fooocus/entry_with_update.py"
else
echo "Fooocus not found at $HOME/Tools/Fooocus"
fi
}
# Per-host / system local overrides fallback
if [ -f "$HOME/.config/zsh/$(hostname)/env.sh" ]; then
source "$HOME/.config/zsh/$(hostname)/env.sh"
elif [ -f "$HOME/.zshrc.local" ]; then
source "$HOME/.zshrc.local"
fi
# Fetch / Banner on interactive terminal start
if [[ -o interactive ]] && [ -z "$TMUX" ] && command -v pfetch >/dev/null 2>&1; then
pfetch
fi
'')
];
};
home.packages = with pkgs; [
pfetch-rs
bitwarden-cli
pandoc
zathura
tmux
];
}

View File

@@ -1,38 +1,44 @@
{ config, lib, pkgs, inputs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
{
imports = [
inputs.disko.nixosModules.disko
./disko.nix
./hardware-configuration.nix
./display-configuration.nix
../../modules/hardware/nvidia.nix
../../modules/apps/gaming.nix
];
imports = [
inputs.disko.nixosModules.disko
./disko.nix
./hardware-configuration.nix
./display-configuration.nix
../../modules/hardware/nvidia.nix
../../modules/apps/gaming.nix
../../modules/apps/local_ai.nix
];
networking.hostName = "hades";
networking.hostName = "hades";
# Enable in-memory compressed swap
zramSwap.enable = true;
# Enable in-memory compressed swap
zramSwap.enable = true;
# Ensure /games directory is accessible by default user
systemd.tmpfiles.rules = [
"d /games 0755 anish users -"
];
# Ensure /games directory is accessible by default user
systemd.tmpfiles.rules = [
"d /games 0755 anish users -"
];
powerManagement.cpuFreqGovernor = "performance";
powerManagement.cpuFreqGovernor = "performance";
hardware.nvidia.prime = {
offload.enable = false;
sync.enable = false;
hardware.nvidia.prime = {
offload.enable = false;
sync.enable = false;
amdgpuBusId = "PCI:121@0:0:0";
nvidiaBusId = "PCI:1@0:0:0";
};
amdgpuBusId = "PCI:121@0:0:0";
nvidiaBusId = "PCI:1@0:0:0";
};
environment.systemPackages = with pkgs; [
mangohud
nvtopPackages.nvidia
];
environment.systemPackages = with pkgs; [
mangohud
nvtopPackages.nvidia
];
}

View File

@@ -8,5 +8,18 @@
ghidra
antigravity-cli
pi-coding-agent
# Clang & LLVM Toolchain
llvmPackages_latest.clang
llvmPackages_latest.lld
llvmPackages_latest.lldb
llvmPackages_latest.llvm
llvmPackages_latest.clang-tools
llvmPackages_latest.libcxx
# Nix Tools
nil
nixfmt
statix
];
}

38
modules/apps/local_ai.nix Normal file
View File

@@ -0,0 +1,38 @@
{ pkgs, inputs, ... }:
{
imports = [
inputs.comfy-ui.nixosModules.default
];
services = {
comfyui = {
enable = true;
gpuSupport = "cuda";
enableManager = true;
port = 8188;
listenAddress = "0.0.0.0";
dataDir = "/var/lib/comfyui";
user = "comfyui";
group = "comfyui";
createUser = true;
};
ollama = {
enable = true;
package = pkgs.ollama-cuda;
host = "0.0.0.0";
port = 11434;
user = "ollama";
group = "ollama";
home = "/var/lib/ollama";
};
open-webui.enable = true;
};
environment.systemPackages = with pkgs; [
comfy-ui-cuda
ollama-cuda
];
}

View File

@@ -1,18 +1,23 @@
{ ... }:
{
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
substituters = [ "https://cache.nixos-cuda.org" ];
trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
};
nixpkgs.config.allowUnfree = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
};
nixpkgs.config.allowUnfree = true;
}

View File

@@ -1,34 +1,38 @@
{ pkgs, ... }:
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.networkmanager.enable = true;
networking.firewall.enable = true;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
time.timeZone = "America/Los_Angeles";
i18n.defaultLocale = "en_US.UTF-8";
networking.networkmanager.enable = true;
networking.firewall.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
time.timeZone = "America/Los_Angeles";
i18n.defaultLocale = "en_US.UTF-8";
environment.systemPackages = with pkgs; [
git
curl
wget
btop
gparted
pciutils
usbutils
egl-wayland
pulseaudio # Provides `pactl` for audio volume control bindings
];
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
system.stateVersion = "26.05";
# Enable running generic unpatched dynamic binaries (Mason, Tree-sitter CLI, language servers, etc.)
programs.nix-ld.enable = true;
environment.systemPackages = with pkgs; [
git
curl
wget
aria2
btop
gparted
pciutils
usbutils
egl-wayland
pulseaudio # Provides `pactl` for audio volume control bindings
];
system.stateVersion = "26.05";
}