From 4c25f9b12269fcb4ea49f076b8d9f79e672c8072 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 22 May 2026 10:41:23 +0100 Subject: docs(rules): document nix/vm.nix symlink invariant Make it explicit that adding, removing, or renaming any chezmoi-deployed config requires a matching update to nix/vm.nix's xdg.configFile / home.file blocks when the corresponding binary is in common.nix. Drives the audit performed in the previous commit. --- .github/copilot-instructions.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 34ea40b..a07e728 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -59,3 +59,14 @@ When editing shell config, all zsh configuration goes in `dot_config/zsh/` — d ## Keybinds reference `KEYBINDS.md` at the repository root documents every non-default keybind across neovim, zellij, zsh, ghostty, and sway. Whenever you add, remove, or change a keybind in any of these tools, you must update `KEYBINDS.md` to reflect the change in the same commit. + +## Nix VM symlink invariant + +The remote-dev Ubuntu VM does NOT run chezmoi. It re-uses configs via Home-Manager symlinks declared in `nix/vm.nix` (the `xdg.configFile` and `home.file` blocks point at `~/.local/share/dotfiles/`). Whenever you **add, remove, or rename** any file or directory under `dot_config/` (or any other chezmoi source path like `dot_claude/`, `private_dot_ssh/`), audit `nix/vm.nix` in the same commit and: + +- If the corresponding binary is provisioned by `nix/common.nix` and is relevant on the headless VM (i.e. not a GUI/wayland tool like sway/mako/waybar/fuzzel/mpv/zathura), **add a matching `xdg.configFile."".source = link "";` entry**. +- If a config is renamed or removed, update / drop the corresponding `link` entry — otherwise `home-manager switch` will fail or leave a dangling symlink. +- Chezmoi attribute prefixes (`executable_`, `private_`, `dot_`) are stripped by chezmoi but NOT by `mkOutOfStoreSymlink`. Map each prefixed source filename to its stripped destination explicitly (see the git-hooks block in `nix/vm.nix` for the reference pattern). +- Paths outside `~/.config/` (e.g. `~/.claude/skills/…`) use `home.file."".source = link "";` instead of `xdg.configFile`. + +Treat the symlink block as part of the chezmoi source tree: a config that lands on the host via chezmoi but not on the VM via nix is the bug class this rule prevents. -- cgit v1.3.1