From 639f3cb82ef9f1e6dd0b47cf506ff3c09fd4a5a7 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 20 May 2026 13:56:11 +0100 Subject: refactor(nix): deployment in vm.nix only; host uses chezmoi for dotfiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per user decision: on the Arch host, chezmoi remains the single deployer of $HOME dotfiles. nix/common.nix's xdg.configFile + sshConfig activation + .zshenv home.file block was causing home-manager to fight chezmoi on every nix-switch, materializing .backup files for nvim, zellij, zsh, git, ghostty, direnv. Resolution: - nix/common.nix: drop the entire deployment block, drop the my.dotfilesPath option, drop the let..in dotfiles/link helpers. Module is now deployment-agnostic: only installs packages. - nix/host.nix: drop my.dotfilesPath; explicit comment that chezmoi owns dotfile deployment on the host. - nix/vm.nix: gains everything previously in common.nix's deployment block — xdg.configFile (nvim/zellij/zsh/git/ghostty/direnv), home.activation.sshConfig, home.file.".zshenv". The 'dotfiles' let-binding (= $HOME/.local/share/dotfiles) and 'link' helper move here too, since they're vm-only now. Host runbook unchanged (`just sync`); first run after pulling will just be a no-op nix-switch instead of a backup-file storm. --- nix/host.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'nix/host.nix') diff --git a/nix/host.nix b/nix/host.nix index d589002..eac2a20 100644 --- a/nix/host.nix +++ b/nix/host.nix @@ -2,6 +2,10 @@ # Arch host Home-Manager profile. Layered on top of `common.nix`; adds # only host-specific concerns that don't make sense on the VM. +# +# Dotfile deployment on the host is owned entirely by **chezmoi** (run +# via `just apply` / `just sync`). Home-Manager here only installs +# binaries and writes the host-only smartcard config below. { imports = [ ./common.nix ]; @@ -9,11 +13,6 @@ home.username = builtins.getEnv "USER"; home.homeDirectory = builtins.getEnv "HOME"; - # The Arch host keeps its chezmoi source state at ~/dotfiles (the - # canonical clone location for the dotfiles repo). The VM convention - # of ~/.local/share/dotfiles doesn't apply here. - my.dotfilesPath = "${builtins.getEnv "HOME"}/dotfiles"; - # ── Smartcard (Yubikey) ──────────────────────────────────────────────────── # Nix's gnupg ships its own scdaemon. Delegate to the system pcscd # service instead of letting nix's scdaemon open the USB device -- cgit v1.3.1