diff options
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -41,7 +41,7 @@ There are no tests or linter. "Does it evaluate/build" is the check. `nil` is in - **Flakes only see git-tracked files.** You must `git add` a new file before a rebuild can see it. This matters even more here, because `modules/` is auto-imported by import-tree (see below). - **`flake.lock` is tracked.** Run `nix flake lock` after adding an input. - The **`STK` input is a `git+file://` path** (`~/stk`), and evaluating the flake needs it present. The `YATwm` input (`~/Documents/Coding/WM/YATwm`) is currently commented out; `homeManager.YATwm` references it lazily, so that's fine as long as nothing imports that module. `nixnode` is always built from `nixy` and then pushed. -- Indentation is **4 spaces**. Multi-line `''` strings (shell scripts, configs) usually start at column 0 rather than following the Nix indentation. Match that. +- Indentation is **tabs** (`tabify-nix.py` converted the tree; the snippet below uses spaces only for display). Multi-line `''` strings (shell scripts, configs) usually start at column 0 rather than following the Nix indentation. Match that. - Leave `system.stateVersion` and `home.stateVersion` alone. ## Architecture @@ -89,6 +89,22 @@ Each file defines both `flake.modules.nixos.<host>` and `flake.nixosConfiguratio `claude-code` is pinned by overriding the nixpkgs package with a vendored manifest (`modules/home-manager/claude-code-manifest-<version>.json`). To bump it, add the new manifest and update the filename in `home.nix`. +### `modules/home-manager/emacs/`: Emacs (`homeManager.emacs`) +`default.nix` builds `myEmacs` (`emacsWithPackages` on `emacs30`), runs it as `services.emacs` (daemon, used via `emacsclient -c`), and installs the tooling it needs (texlive, ispell, haskell-language-server...). The elisp lives in `emacs/config/` (`init.el`, `config/teh-config-*.el`, `lisp/`, `gnu.png`), and each of those is linked into `~/.emacs.d` with `config.lib.file.mkOutOfStoreSymlink`, pointing at this repo checkout. **Editing elisp needs no rebuild**; just restart Emacs. Only new links or Nix package changes need a switch. A switch restarts `emacs.service` whenever the tracked elisp (`X-Restart-Triggers` on the `./config` store copy) or the Emacs package changed, so unsaved buffers are lost. The rest of `~/.emacs.d` (elpa/, eln-cache/, org-roam.db, recentf...) is untracked runtime state. + +Packages are **hybrid**: +- Anything in the `epkgs` list comes from Nix. emacsWithPackages puts these on `package-directory-list`, so `use-package-always-ensure t` treats them as installed and doesn't download them. +- Every other `use-package` in the config is still installed at runtime by package.el into `~/.emacs.d/elpa`. ghostel and popterm are deliberately kept there because nixpkgs lags far behind upstream. +- To move a package to Nix: add it to `epkgs`, switch, then delete its `~/.emacs.d/elpa/<pkg>-*` dir. package.el loads the highest version, so a stale elpa copy would win. +- Packages that aren't in nixpkgs (trust-manager, org-margin) are built inline with `trivialBuild` + `fetchFromGitHub`, pinned by rev and hash, and their `use-package` uses `:ensure nil` (trivialBuild packages are invisible to package.el). +- **Don't use `:vc` or package-vc for new packages.** It fetches `elpa-packages.eld` from elpa.gnu.org on startup. elpa.gnu.org is unreachable over IPv6 from nixy, and Emacs has no IPv4 fallback, so the daemon hangs until systemd's 90s start timeout kills it and restarts it in a loop. claude-code-ide is the one package-vc install left; it's already installed, but reinstalling it would hit the same hang. +- straight.el is no longer used. use-package is the built-in Emacs 30 one. + +Other notes: +- Customize writes to an untracked `~/.emacs.d/custom.el` (`custom-file` in `init.el`), so trust-manager paths and other machine-local settings stay out of this public repo. Don't put `custom-set-variables` back in `init.el`. +- mu4e is disabled: the `require` and the `C-z e` binding in `teh-config-keybinds.el` are commented out, as are `mu`, `mu4e` and `isync` in `default.nix`. `teh-config-mu4e.el` is kept but not loaded, and `.mbsyncrc` is intentionally not in the repo. +- To check the config without switching, run `nixos-rebuild build --flake .#nixy`, then `result/etc/profiles/per-user/boss/bin/emacs --batch -l ~/.emacs.d/init.el`. + ### `modules/my-pkgs/` `adom.nix` and `stk-installers.nix` are flake packages. `default.nix` exports `nixos.my-pkgs`, an overlay that exposes `inputs.self.packages.<system>.adom` as `pkgs.adom`. `stk-installers` is served (currently commented out) from nixnode. |
