nixos-config
CLAUDE.md3.6k starsChanged 46 days agoBSD-3-ClauseView on GitHub
This is a cross-platform NixOS configuration repository supporting both macOS (via nix-darwin) and NixOS systems. It uses Nix Flakes exclusively and follows a modular architecture. Important: When working with GUI applications, ensure Wayland compatibility. For example: - Use rofi-wayland instead of rofi - Check for Wayland-specific versions of applications - Some X11-only applications may need XWayland compatibility layer **NixOS (x86_64-linux):** Important: - After making changes to Nix configuration files, run nix run .#build-switch - After making changes to Emacs configuration…
We split this CLAUDE.md into the rules it gives an agent
16 rules. About 0 are common, 4 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Use rofi-wayland instead of rofi
- Distinctive: line 17
Check for Wayland-specific versions of applications
- Very specific: line 43
After making changes to Nix configuration files, run nix run .#build-switch
- Very specific: line 44
After making changes to Emacs configuration (modules/shared/config/emacs/config.org), run nix run .#build-switch-emacs
- Very specific: line 125
Cross-platform packages: Add to modules/shared/packages.nix
- Very specific: line 126
NixOS-only packages: Add to modules/nixos/packages.nix
- Very specific: line 127
macOS-only packages: Add to modules/darwin/packages.nix
- Very specific: line 128
Homebrew casks (macOS): Add to modules/darwin/casks.nix
- Very specific: line 131
Create a new .nix file in overlays/ directory.
- Distinctive: line 148
Important: When making changes to Emacs configuration:
- Very specific: line 150
If adding a new package, also add it to modules/shared/emacs.nix
- Very specific: line 151
Run nix run .#build-switch to rebuild the configuration
- Very specific: line 154
Update cheatsheets: Check if the relevant cheatsheets in /home/dustin/cheatsheets/ need to be updated with new keybindings or features …
- Distinctive: line 163
Always test configuration changes before applying:
- Very specific: line 164
Run nix flake check to validate the flake
- Distinctive: line 165
Use platform-specific build command to test
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
This is a cross-platform NixOS configuration repository supporting both macOS (via nix-darwin) and NixOS systems. It uses Nix Flakes exclusively and follows a modular architecture.
System Environment
- Display Server: Wayland (not X11)
- Desktop Environment: KDE Plasma 6
- Window Manager: KWin (Wayland)
Important: When working with GUI applications, ensure Wayland compatibility. For example:
- Use
rofi-waylandinstead ofrofi - Check for Wayland-specific versions of applications
- Some X11-only applications may need XWayland compatibility layer
Key Commands
Building and Switching Configurations
NixOS (x86_64-linux):
# Build and switch to new configuration
nix run .#build-switch
# Build, switch, and restart Emacs daemon (use after Emacs config changes)
nix run .#build-switch-emacs
# Install fresh system (without secrets)
nix run .#install
# Install fresh system (with secrets)
nix run .#install-with-secrets
# Clean up old generations and boot files (frees disk space)
nix run .#cleanImportant:
- After making changes to Nix configuration files, run
nix run .#build-switch - After making changes to Emacs configuration (
modules/shared/config/emacs/config.org), runnix run .#build-switch-emacs
macOS (x86_64-darwin):
# Test build without switching
nix run .#build
# Build and switch to new configuration
nix run .#build-switch
# Rollback to previous generation
nix run .#rollback
# Clean up old generations (frees disk space)
nix run .#cleanDevelopment Commands
# Update flake inputs
nix flake update
# Check flake
nix flake check
# Format Nix files
nixpkgs-fmt .
# Lint Nix code (runs in CI)
statix checkArchitecture
Directory Structure
hosts/- Host-specific configurations (darwin/default.nix for macOS, nixos/default.nix for NixOS)modules/- Modular configuration components:shared/- Cross-platform configurations (packages, home-manager, fonts)nixos/- Linux-specific packages and configurationsdarwin/- macOS-specific packages and Homebrew integration
overlays/- Auto-loading Nix overlays (any .nix file here runs automatically)apps/- Platform-specific build and deployment scriptstemplates/- Starter templates for new users
Key Patterns
- Module Inheritance: Platform-specific modules extend shared configurations
# Example from modules/nixos/packages.nix packages = with pkgs; [ # Shared packages are inherited ] ++ sharedPackages; - Auto-loading Overlays: Drop any .nix file in
overlays/and it loads automatically via:# modules/shared/default.nix nixpkgs.overlays = import ../../overlays {inherit lib pkgs inputs outputs;}; - Secrets Management: Uses
agenixfor encrypted secrets- Secrets defined in
hosts/{platform}/secrets/secrets.nix - Age keys in
hosts/{platform}/secrets/keys/
- Secrets defined in
- Home Manager Integration: User-level configurations in
modules/shared/home-manager.nix
Important Configuration Files
flake.nix- Main entry point defining inputs and system configurationshosts/nixos/default.nix- NixOS system configuration (hostname: "felix")hosts/darwin/default.nix- macOS system configurationmodules/shared/packages.nix- Cross-platform package definitionsmodules/shared/home-manager.nix- Shell, editor, and tool configurations
Working with This Repository
CRITICAL: Git Tracking Requirement
IMPORTANT: When creating ANY new file in this repository (overlays, modules, configurations, etc.), you MUST add it to git with git add before running nix run .#build-switch. Nix flakes only see files tracked by git, so untracked files will cause build failures. This applies to ALL files, not just overlays.
Adding Packages
- Cross-platform packages: Add to
modules/shared/packages.nix - NixOS-only packages: Add to
modules/nixos/packages.nix - macOS-only packages: Add to
modules/darwin/packages.nix - Homebrew casks (macOS): Add to
modules/darwin/casks.nix
Creating Overlays
Create a new .nix file in overlays/ directory. It will be automatically loaded.
Modifying Shell Configuration
Edit modules/shared/home-manager.nix for:
- Zsh configuration and aliases
- Git settings
- Terminal emulator (Alacritty) configuration
- Tmux settings
- SSH configuration
Editing Emacs Configuration
The Emacs configuration is a literate Org-mode file at modules/shared/config/emacs/config.org. This file:
- Contains all Emacs configuration in Org-mode code blocks
- Is automatically tangled to
config.elwhen building - Includes comprehensive documentation alongside the configuration
- Supports adding new packages and customizations in the appropriate sections
Important: When making changes to Emacs configuration:
- Edit
modules/shared/config/emacs/config.org - If adding a new package, also add it to
modules/shared/emacs.nix - Run
nix run .#build-switchto rebuild the configuration - Restart the Emacs daemon with:
emacsclient -e "(kill-emacs)" - The daemon will automatically restart when you next use Emacs
- Update cheatsheets: Check if the relevant cheatsheets in
/home/dustin/cheatsheets/need to be updated with new keybindings or features (especiallyemacs.md)
System-specific Changes
- NixOS boot/kernel:
hosts/nixos/default.nix - macOS system settings:
hosts/darwin/default.nix - Disk partitioning (NixOS):
hosts/nixos/disk-config.nix
Testing Changes
Always test configuration changes before applying:
- Run
nix flake checkto validate the flake - Use platform-specific build command to test
- Review changes before switching
CI/CD
GitHub Actions automatically:
- Tests starter template builds
- Runs statix linting on Nix code
- Updates flake.lock weekly
- Manages dependencies via Dependabot
Trending
Quiet since April.about the whole repository
Who's talking about dustinlyons/nixos-config
- A Hacker News story“Show HN: A simple Nix config for Mac/Linux”Hacker News · Mar 6, 2023 · 2 points
- @isabelroses.com“this one github.com/dustinlyons/...”Bluesky · Mar 29, 2025 · 1 likes
- NixOS/nixpkgs“Installing fish and atuin via Nix on macOS - unknown command error when starting fish or running any commands”GitHub · Jul 16, 2024 · 1 reactions
- A Hacker News story“Show HN: You can try my unified Nix environment for macOS/NixOS”Hacker News · Nov 13, 2023 · 1 points
- nix-community/nixos-anywhere“Using --build-on-remote targets i686-linux”GitHub · Aug 1, 2023 · 1 reactions
The biggest 5 of 17 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 17
Talked about on GitHub, Hacker News and Bluesky (17 times).
On GitHub · 14
- Jul 16, 2024Installing fish and atuin via Nix on macOS - unknown command error when starting fish or running any commands — NixOS/nixpkgs1 reaction · 3 comments
- Aug 1, 2023Using --build-on-remote targets i686-linux — nix-community/nixos-anywhere1 reaction · 3 comments
- Apr 4, 2026Remove emacs — lucg/nix-config0 reactions
- Apr 4, 2026Update from dustinlyons/nixos-config — lucg/nix-config0 reactions
- Dec 3, 2025Question: using the example flake w/ home manager — BirdeeHub/nixCats-nvim0 reactions · 1 comment
9 more on GitHub
- Jul 8, 2025feat(nix-darwin): Review and implement nix-secrets management — aRustyDev/dotfiles0 reactions
- May 30, 2025Reproducible MacOS — chianyungcode/dotfiles0 reactions · 1 comment
- Feb 26, 2025chore: prune closures, restructure — DavSanchez/nix-dotfiles0 reactions
- Feb 22, 2025Cleanup, and migration to MacOS + Nix — thedevbirb/.dotfiles0 reactions
- Dec 17, 2024Cask 'mysql-client' is unavailable: No Cask with this name exists. — zhaofengli/nix-homebrew0 reactions · 1 comment
- Aug 30, 2024Installing macOS applications — samueljoli/lakay0 reactions · 1 comment
- Jun 18, 2024glibc: darwin build failed — WilliamHsieh/dotfiles0 reactions · 1 comment
- Jun 3, 2024deny_network_access error when trying to install anything that's depending on xz — zhaofengli/nix-homebrew0 reactions
- Jan 22, 2024user-defined home.nix template — ublue-os/fleek0 reactions · 2 comments
On Hacker News · 2
- Mar 6, 2023Show HN: A simple Nix config for Mac/Linux2 points
- Nov 13, 2023Show HN: You can try my unified Nix environment for macOS/NixOS1 point
On Bluesky · 1
- Mar 29, 2025this one github.com/dustinlyons/... — @isabelroses.com1 likes and repost · 1 reply
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

