Updated some deprecation warnings, moved all firefox instances to shared module, added claude.md file for agent work, fixed zfs kernel version, pinned to 6.10

This commit is contained in:
Nate Anderson 2025-07-08 11:55:30 -06:00
parent c7439fa85d
commit 662cfa3fbe
16 changed files with 367 additions and 97 deletions

163
CLAUDE.md Normal file
View File

@ -0,0 +1,163 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Common Commands
### Building and Rebuilding Systems
```bash
# Rebuild NixOS configuration for current system
sudo nixos-rebuild switch --flake .
# Build for specific system
sudo nixos-rebuild switch --flake .#nate-work
sudo nixos-rebuild switch --flake .#nate
sudo nixos-rebuild switch --flake .#luci
sudo nixos-rebuild switch --flake .#jaci
sudo nixos-rebuild switch --flake .#scrappy
# Test configuration without switching
sudo nixos-rebuild test --flake .
# Check configuration without building
nix flake check
```
### Package Management
```bash
# Update flake inputs
nix flake update
# Run garbage collection
nix-collect-garbage -d
# Check system generations
nixos-rebuild list-generations
# Rollback to previous generation
sudo nixos-rebuild switch --rollback
```
### Home Manager
```bash
# Apply home manager configuration
home-manager switch --flake .
# For specific user configurations
home-manager switch --flake .#nate-work
```
## Architecture Overview
This is a multi-user NixOS configuration repository using Nix flakes. The repository manages configurations for multiple machines and users across different environments.
### Repository Structure
- **flake.nix**: Main flake configuration defining all system configurations
- **{user}/**: Individual user configuration directories (nate, nate-work, luci, jaci, scrappy)
- **shared/**: Shared modules and configurations across systems
- **{user}/default.nix**: System-level configuration for each user/machine
- **{user}/desktop-configuration.nix**: Desktop environment configuration
- **{user}/modules/**: User-specific modules and configurations
- **{user}/dotfiles/**: User dotfiles and application configurations
### Key Components
#### System Configurations
Each system configuration follows this pattern:
- `default.nix`: Main system configuration with user settings, hostname, desktop environment
- `desktop-configuration.nix`: Desktop environment setup (Sway/Hyprland)
- `modules/home-manager/home.nix`: Home Manager configuration
- `nixos/hardware-configuration.nix`: Hardware-specific settings
#### Supported Desktop Environments
- **Sway**: Wayland compositor (default)
- **Hyprland**: Modern Wayland compositor
- Desktop choice configured via `deskCfg.de` option
#### User Management
- Custom `main_user` module handles user creation
- Desktop users get additional groups (video, audio, adbusers)
- Server users get minimal groups (wheel, networkmanager)
#### Package Management
- Stable packages from nixpkgs 25.05
- Unstable packages available via `nixpkgs-unstable`
- Catppuccin theme integration via catppuccin.nix
- NUR (Nix User Repository) overlay enabled
### Configuration Patterns
#### User-Specific Settings
Each user configuration defines:
```nix
{
userName = "username";
fullName = "Full Name";
email = "email@domain.com";
hostName = "hostname";
desktop = "sway" or "hyprland";
gaming = true/false;
}
```
#### Module System
- Custom modules in `modules/` directories
- Shared modules in `shared/modules/`
- Options defined with `lib.mkOption`
- Conditional configuration with `lib.mkIf`
#### Home Manager Integration
- Home Manager configurations in `modules/home-manager/home.nix`
- Dotfiles linked from `dotfiles/` directories
- User packages defined in `homePackages`
### Development Environment
#### Installed Development Tools
- **Editors**: Helix (default), Emacs
- **Languages**: Go, Python, Clojure, Nix
- **LSPs**: gopls, nil, bash-language-server, python-lsp-server
- **Tools**: Docker, distrobox, jq, make, cmake
- **Version Control**: Git with delta, direnv
#### Shell Configuration
- **Default Shell**: Zsh with Oh My Zsh
- **Theme**: half-life
- **Plugins**: git, ssh-agent
- **Aliases**: Modern Unix tools (lsd, bat, ripgrep, fd, fzf)
### Security and Maintenance
#### Automatic Updates
- `auto-update.nix` module for automatic system updates
- Garbage collection configured weekly
- Boot loader limited to 5 generations
- Store optimization enabled
#### Security Features
- ClamAV antivirus on work systems
- Gnome Keyring for SSH secrets
- Firewall configuration for servers
- Initial password set to "password" (should be changed)
### Server Configuration
For server deployments, use `shared/server-configuration.nix` which provides:
- SSH server option
- NFS server with configurable exports
- Syncthing for file synchronization
- Radicale CalDAV server
- Printer sharing via CUPS/Avahi
### Special Features
#### Claude Code Integration
- Work profile: `claudew` command (uses AWS Bedrock)
- Personal profile: `claudep` command (uses standard API)
- Configuration directories: `/home/nate/.claude-work` and `/home/nate/.claude-personal`
#### Catppuccin Theme
- Consistent theming across applications
- Macchiato variant with lavender accent
- GTK, Qt, and terminal theme integration

12
flake.lock generated
View File

@ -78,11 +78,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1749794982,
"narHash": "sha256-Kh9K4taXbVuaLC0IL+9HcfvxsSUx8dPB5s5weJcc9pc=",
"lastModified": 1751792365,
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ee930f9755f58096ac6e8ca94a1887e0534e2d81",
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
"type": "github"
},
"original": {
@ -94,11 +94,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1750005367,
"narHash": "sha256-h/aac1dGLhS3qpaD2aZt25NdKY7b+JT0ZIP2WuGsJMU=",
"lastModified": 1751741127,
"narHash": "sha256-t75Shs76NgxjZSgvvZZ9qOmz5zuBE8buUaYD28BMTxg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6c64dabd3aa85e0c02ef1cdcb6e1213de64baee3",
"rev": "29e290002bfff26af1db6f64d070698019460302",
"type": "github"
},
"original": {

View File

@ -40,7 +40,7 @@ in
];
nixpkgs.overlays = [
inputs.nur.overlay
inputs.nur.overlays.default
];
# Enable flakes feature

View File

@ -12,7 +12,7 @@
# nixpkgs.config.allowUnfree = true;
# inputs.nixpkgs-stable.config.allowUnfree = true;
imports = [
../apps/firefox/firefox.nix
../../../shared/modules/apps/firefox/firefox.nix
];
home.username = userName;
@ -49,7 +49,8 @@
gimp
# Install fonts
(nerdfonts.override { fonts = [ "Hermit" "Gohu" ]; })
nerd-fonts.hurmit
# TODO need to add gohu font
# Style
catppuccin-kvantum
libsForQt5.qtstyleplugin-kvantum
@ -81,26 +82,8 @@
plugins = [ "git" ];
theme = "half-life";
};
initExtra = ''
alias ask="nix-shell -p python310Packages.openai --run 'python ~/source/python/chat.py'"
fzf_projects() {
DIR=`
fd .git --search-path="$HOME/source/" -H --ignore-file ~/.config/fd-ignore -tdirectory | \
xargs dirname | \
sed 's|$HOME||g' | \
sort | \
uniq | \
fzf --preview 'ls $HOME/{}/README.md 2>/dev/null && bat $HOME/{}/README.md || printf "No README.md file found in this directory\n%s" {}' --preview-window=top | \
xargs printf "$HOME/%s/"
`
cd $DIR
}
alias p="fzf_projects source/"
### Busykid Bash Functions
'';
initContent = ''
'';
};

View File

@ -78,7 +78,7 @@ in
plugins = [ "git" ];
theme = "dieter";
};
initExtra = ''
initContent = ''
eval "$(direnv hook zsh)"
alias ls="lsd"

View File

@ -14,7 +14,7 @@
boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "zfs" ];
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.kernelPackages = pkgs.linuxPackages_6_10;
boot.zfs.forceImportRoot = false;

View File

@ -1,23 +0,0 @@
yt-audio() {
nix-shell -p yt-dlp --run "yt-dlp -x $1 --audio-format mp3"
}
docker_mysql() {
if [ -z "$1" ]; then
echo "Usage: docker_mysql <mysql_container_name>"
return 1
fi
docker exec -it "$1" mysql -u root -ppassword
}
# Tab-completion for docker_mysql function
_complete_docker_mysql() {
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=($(compgen -W "$(docker ps --format '{{.Names}}' | grep mysql)" -- $cur))
}
# Register the completion for the docker_mysql function
complete -F _complete_docker_mysql docker_mysql
# Git restore file, like git restore but works for staged changes as well
gres() {
git restore --source=HEAD --staged --worktree -- "$1"
}

View File

@ -0,0 +1,117 @@
yt-audio() {
nix-shell -p yt-dlp --run "yt-dlp -x $1 --audio-format mp3"
}
docker_mysql() {
if [ -z "$1" ]; then
echo "Usage: docker_mysql <mysql_container_name>"
return 1
fi
docker exec -it "$1" mysql -u root -ppassword
}
# Tab-completion for docker_mysql function
_complete_docker_mysql() {
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=($(compgen -W "$(docker ps --format '{{.Names}}' | grep mysql)" -- $cur))
}
# Register the completion for the docker_mysql function
complete -F _complete_docker_mysql docker_mysql
# Git restore file, like git restore but works for staged changes as well
gres() {
git restore --source=HEAD --staged --worktree -- "$1"
}
# Nixos upgrade functions
upgrade() {
local command="$1"
local profile="$2"
local flake_path="$HOME/nixos"
# Define valid commands
local valid_commands=("switch" "boot" "test" "build" "dry-build" "dry-activate" "edit" "repl" "build-vm" "build-vm-with-bootloader" "build-image")
# Check if command is provided
if [[ -z "$command" ]]; then
echo "Error: No command specified"
echo "Usage: upgrade <command> [profile]"
echo "Valid commands: ${valid_commands[*]}"
return 1
fi
# Validate command
local valid_command=false
for valid_cmd in "${valid_commands[@]}"; do
if [[ "$command" == "$valid_cmd" ]]; then
valid_command=true
break
fi
done
if [[ "$valid_command" != true ]]; then
echo "Error: Invalid command '$command'"
echo "Valid commands: ${valid_commands[*]}"
return 1
fi
# Check if flake directory exists
if [[ ! -d "$flake_path" ]]; then
echo -e "Error: Flake directory '$flake_path' does not exist, check function definition:\n\n\t`function upgrade`"
return 1
fi
# Check if flake.nix exists
if [[ ! -f "$flake_path/flake.nix" ]]; then
echo "Error: flake.nix not found in '$flake_path'"
return 1
fi
# If profile is provided, validate it exists in flake.nix
if [[ -n "$profile" ]]; then
if ! awk '/nixosConfigurations = \{/,/^\s*\}/' "$flake_path/flake.nix" | \
grep -E "^\s*$profile\s*=" > /dev/null; then
echo "Error: Profile '$profile' not found in flake.nix"
echo "Available profiles:"
# Extract available profiles from nixosConfigurations section
awk '/nixosConfigurations = \{/,/^\s*\}/' "$flake_path/flake.nix" | \
grep -E "^\s*[a-zA-Z0-9_-]+\s*=.*nixpkgs\.lib\.nixosSystem" | \
sed -E 's/^\s*([a-zA-Z0-9_-]+)\s*=.*/ - \1/'
return 1
fi
# Build the full flake reference
local flake_ref="$flake_path#$profile"
echo "Running: sudo nixos-rebuild $command --flake $flake_ref"
sudo nixos-rebuild "$command" --flake "$flake_ref"
else
echo "Error: No profile provided."
echo "Usage: upgrade <command> [profile]"
return 1
fi
}
# Add tab completion for the function
_upgrade_completion() {
local cur="${COMP_WORDS[COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"
case $COMP_CWORD in
1)
# Complete command names
local commands="switch boot test build dry-build dry-activate edit repl build-vm build-vm-with-bootloader build-image"
COMPREPLY=($(compgen -W "$commands" -- "$cur"))
;;
2)
# Complete profile names from flake.nix
if [[ -f "$HOME/nixos/flake.nix" ]]; then
local profiles=$(grep -E "^\s*[a-zA-Z0-9_-]+\s*=" "$HOME/nixos/flake.nix" | \
grep -A5 -B5 "nixosConfigurations" | \
sed -n 's/^\s*\([a-zA-Z0-9_-]*\)\s*=.*/\1/p' | \
sort -u)
COMPREPLY=($(compgen -W "$profiles" -- "$cur"))
fi
;;
esac
}
# Register the completion function
complete -F _upgrade_completion upgrade

View File

@ -47,6 +47,17 @@ in
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"MySQL Docs" = {
urls = [{
template = "https://dev.mysql.com/doc/search";
params = [
{ name = "d"; value = "371"; }
{ name = "p"; value = "1"; }
{ name = "q"; value = "{searchTerms}"; }
];
}];
definedAliases = [ "@mysql" ];
};
};
};
settings = {

View File

@ -33,7 +33,7 @@
# ];
imports = [
../apps/firefox/firefox.nix
../../../shared/modules/apps/firefox/firefox.nix
../hypr/hypr_home.nix
];
@ -67,18 +67,16 @@
# Dev Tools
#
helix
vscodium-fhs
unstable.distrobox
unstable.docker_25
docker-compose
jq
gnumake
insomnia
mariadb
lsp-ai
python3
cmake
claude-code
unstable.claude-code
# proto
protobuf
protoc-gen-dart
@ -87,7 +85,10 @@
delve
gotools
go-tools
govulncheck
golangci-lint
go-swag
delve
# clojure
jre17_minimal
@ -99,13 +100,11 @@
### LSP's
gopls
nil # Nix LSP
nil
nodePackages_latest.bash-language-server
openscad-lsp
vscode-langservers-extracted # provides eslint, markdown, json, css, and html lsp
python311Packages.python-lsp-server
gopls
delve
yaml-language-server
elixir-ls
@ -165,7 +164,6 @@
gnome-disk-utility
kdePackages.filelight
hugo
go-swag
unstable.llama-cpp
#
@ -176,33 +174,19 @@
libsForQt5.qt5ct
# Install fonts
lato
# (unstable.nerdfonts.override { fonts = [ "Iconsolata" "Hermit" "Overpass" ]; })
unstable.nerd-fonts.hurmit
unstable.nerd-fonts.overpass
unstable.nerd-fonts.monaspace
monaspace
# fonts.packages = [
# ...
# pkgs.nerd-fonts._0xproto
# pkgs.nerd-fonts.droid-sans-mono
# ] recursive
];
};
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file."${config.xdg.configHome}" = {
source = ../../dotfiles;
recursive = true;
};
# For applying custom styles
# home.file.".mozilla/firefox/default" = {
# source = ../../misc/firefox_styles;
# recursive = true;
# };
# location where stylus data is kept
# /home/nate/.mozilla/firefox/default/storage/default/moz-extension+++77a1d59f-183c-4439-b249-fdae98b7bd7b/idb
# enable saving ssh secrets (needed for go mod installing private packages)
services.gnome-keyring.enable = true;
services.gnome-keyring.components = [ "ssh" "secrets" ];
# Enable bluetooth headphone controls
@ -214,7 +198,6 @@
XCURSOR_THEME = "Bibata-Modern-Classic";
XCURSOR_SIZE = "24";
HYPRCURSOR_THEME = "Bibata-Modern-Classic";
# HYPRCURSOR_SIZE = "24";
};
# Git setup
@ -238,11 +221,11 @@
programs = {
direnv = {
enable = true;
enableZshIntegration = true; # see note on other shells below
enableZshIntegration = true;
nix-direnv.enable = true;
};
bash.enable = true; # see note on other shells below
bash.enable = true;
};
# Zsh setup
@ -258,18 +241,40 @@
'';
};
initContent = ''
# direnv setup
eval "$(direnv hook zsh)"
# eval "$(ssh-agent)" >/dev/null
# export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent
# History
HISTSIZE=10000
SAVEHIST=10000
setopt SHARE_HISTORY
setopt APPEND_HISTORY
# Work envs
source ~/.vasion_env
# bonus functions
source ~/.config/zsh_functions
source ~/.config/zsh_functions.zsh
export GOBIN=~/go/bin
export PATH=$PATH:$GOBIN
'';
export NIX_SHELL=/usr/bin/env zsh
claudew() {
export ANTHROPIC_MODEL=us.anthropic.claude-sonnet-4-20250514-v1:0
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-west-2
export CLAUDE_CONFIG_DIR=/home/nate/.claude-work
claude
}
claudep() {
unset ANTHROPIC_MODEL
unset CLAUDE_CODE_USE_BEDROCK
unset AWS_REGION
export CLAUDE_CONFIG_DIR=/home/nate/.claude-personal
claude
}
'';
shellAliases = {
ls="lsd";
l="lsd --almost-all --long";
@ -277,6 +282,9 @@
lS="lsd --oneline --classic";
lt="lsd --tree --depth=2";
cat="bat --paging=never";
ccat="cat";
catp="bat --paging=never -p";
catplain="bat --paging=never -p";
rm="rm -i";
};
syntaxHighlighting = {

View File

@ -33,7 +33,7 @@
# ];
imports = [
../apps/firefox/firefox.nix
../../../shared/modules/apps/firefox/firefox.nix
];
home.username = userName;
@ -58,12 +58,8 @@
#
dbeaver-bin
helix
# kakoune
# flutter316
docker
docker-compose
# fossil
# fnc
unstable.godot
jq
python310

View File

@ -18,7 +18,9 @@
# Use xanmod kernel. List kernels by running:
# `nix repl`
# > :l <nixpkgs>
# > pkgs.linuxPackages
# > pkgs.linuxPackages<Tab>
# > ## Should display a list of available kernels
# > :quit
boot.kernelPackages = pkgs.linuxPackages_xanmod;
fileSystems."/" =

View File

@ -39,7 +39,7 @@ in
];
nixpkgs.overlays = [
inputs.nur.overlay
inputs.nur.overlays.default
];

View File

@ -35,7 +35,7 @@
# ];
imports = [
../apps/firefox/firefox.nix
../../../shared/modules/apps/firefox/firefox.nix
];
home.username = userName;
@ -332,7 +332,7 @@
plugins = [ "fossil" "git" ];
theme = "half-life";
};
initExtra = ''
initContent = ''
eval "$(direnv hook zsh)"
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent

View File

@ -13,17 +13,18 @@ in
config = lib.mkIf cfg.enable {
programs.firefox = {
# Add pipewire support
package = (pkgs.wrapFirefox (pkgs.firefox-unwrapped.override { pipewireSupport = true;}) {});
# package = (pkgs.wrapFirefox (pkgs.firefox-unwrapped.override { pipewireSupport = true;}) {});
enable = true;
profiles = {
default = {
id = 0;
name = "default";
isDefault = true;
extensions = with pkgs; [
extensions.packages = with pkgs; [
nur.repos.rycee.firefox-addons.darkreader
nur.repos.rycee.firefox-addons.keepassxc-browser
nur.repos.crazazy.firefox-addons.ublock-origin
nur.repos.bandithedoge.firefoxAddons.stylus
];
search = {
# Replace default firefox search engine config with this one
@ -46,12 +47,22 @@ in
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"MySQL Docs" = {
urls = [{
template = "https://dev.mysql.com/doc/search";
params = [
{ name = "d"; value = "371"; }
{ name = "p"; value = "1"; }
{ name = "q"; value = "{searchTerms}"; }
];
}];
definedAliases = [ "@mysql" ];
};
};
};
settings = {
"browser.startup.blankWindow" = true;
"browser.startup.homepage" = "https://www.startpage.com/do/mypage.pl?prfe=11898a1adf7b7dfb587580692f358773a11ca25e993b8e077476641cec033319e15f2449c345f5be919fd0a082015c3e4ed23143bd4337512466c04c2999831a54abca2eaeb42963c63ff064";
"browser.newtabpage.enabled" = false;
"browser.search.region" = "US";
"browser.search.isUS" = true;
"distribution.searchplugins.defaultLocale" = "en-US";
@ -68,6 +79,8 @@ in
"extensions.formautofill.creditCards.enabled" = false;
"extensions.formautofill.addresses.enabled" = false;
"browser.toolbars.bookmarks.visibility" = "always";
# For applying userContent.css - not being used
# "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
# "browser.newtabpage.pinned" = [{
# title = "NixOS";
# url = "https://nixos.org";

View File

@ -187,7 +187,7 @@ in
listenAddresses = [ "*:631" ];
allowFrom = [ "all" ];
browsing = true;
browserAddress = "192.168.1.169:631";
# browserAddress = "192.168.1.169:631";
defaultShared = true;
openFirewall = true;
};