Fix stale documentation in CLAUDE.md
- Remove deleted fonts.nix from directory layout - Update 'Adding a New Program' section to reflect ponytail cleanup: simple packages go in common.nix, per-file only for programs needing real configuration - Update Rules section to document common.nix and per-file program patterns
This commit is contained in:
18
CLAUDE.md
18
CLAUDE.md
@@ -9,8 +9,7 @@ hosts/
|
|||||||
nikita-nixos/ # nikita's machine
|
nikita-nixos/ # nikita's machine
|
||||||
home/
|
home/
|
||||||
packages-base.nix # universal packages every host gets (neovim, ripgrep, etc.)
|
packages-base.nix # universal packages every host gets (neovim, ripgrep, etc.)
|
||||||
programs/ # one file per installable program
|
programs/ # installable programs (common.nix for simple packages, per-file for configured programs)
|
||||||
fonts.nix # font config
|
|
||||||
rofi.nix # rofi config + packages
|
rofi.nix # rofi config + packages
|
||||||
symlinks.nix # home-manager symlinks
|
symlinks.nix # home-manager symlinks
|
||||||
tmux.nix # tmux config
|
tmux.nix # tmux config
|
||||||
@@ -21,26 +20,29 @@ system/ # NixOS system-level modules
|
|||||||
|
|
||||||
## Adding a New Program
|
## Adding a New Program
|
||||||
|
|
||||||
1. Create `home/programs/<name>.nix`:
|
**For simple packages (no config):** Add the package to `home/programs/common.nix`'s `home.packages` list.
|
||||||
|
|
||||||
|
**For programs that need configuration** (session variables, extra options, dependencies): Create `home/programs/<name>.nix`:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
home.packages = [ pkgs.<package-name> ];
|
# configuration + packages
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The filename is the program name; the package attribute can differ (e.g. `godot.nix` uses `pkgs.godot_4`).
|
Then add the import to `hosts/<host>/home.nix`:
|
||||||
|
|
||||||
2. Add the import to whichever hosts should have it in `hosts/<host>/home.nix`:
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
../../home/programs/<name>.nix
|
../../home/programs/<name>.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Example: `rustup.nix` needs config (session variables) so it gets its own file. Simple packages like `lazygit` go in `common.nix`.
|
||||||
|
|
||||||
## Rules
|
## Rules
|
||||||
|
|
||||||
- `home/packages-base.nix` — shared baseline, imported by every host. Only add truly universal tools here (shell utilities, editors).
|
- `home/packages-base.nix` — shared baseline, imported by every host. Only add truly universal tools here (shell utilities, editors).
|
||||||
- `home/programs/` — one file per program. Hosts opt in by importing.
|
- `home/programs/common.nix` — simple packages that just need to be installed (no extra config).
|
||||||
|
- `home/programs/<name>.nix` — programs that need real configuration beyond just `home.packages`. Hosts opt in by importing.
|
||||||
- `home/<tool>.nix` (tmux, zsh, rofi, etc.) — for programs that need configuration beyond just installing a package. Same opt-in pattern via host imports.
|
- `home/<tool>.nix` (tmux, zsh, rofi, etc.) — for programs that need configuration beyond just installing a package. Same opt-in pattern via host imports.
|
||||||
- `system/` modules are NixOS system-level config (not home-manager). Add them to `hosts/<host>/default.nix`.
|
- `system/` modules are NixOS system-level config (not home-manager). Add them to `hosts/<host>/default.nix`.
|
||||||
|
|||||||
Reference in New Issue
Block a user