aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-20 13:56:10 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-20 13:56:10 +0100
commit58f2d61be4c55c7cf7bdbb12f3fed6794e7481b5 (patch)
treee5fffde7bcb1bc6778e0e7b489b5666dbe755746
parent3bc07df183cba19a9824ccf074041347a8bd1490 (diff)
downloaddotfiles-58f2d61be4c55c7cf7bdbb12f3fed6794e7481b5.tar.gz
dotfiles-58f2d61be4c55c7cf7bdbb12f3fed6794e7481b5.tar.bz2
dotfiles-58f2d61be4c55c7cf7bdbb12f3fed6794e7481b5.zip
fix(nix): parameterize dotfiles path per profile; rename dockerfile LSP
- common.nix hardcoded the runtime dotfiles checkout to ~/.local/share/dotfiles, which is correct for the remote-dev VM but not the Arch host (where the canonical clone lives at ~/dotfiles). ssh activation was failing with 'cannot stat /home/sommerfeld/.local/share/dotfiles/private_dot_ssh/config' on every host nix-switch. Promote the path to a typed option (config.my.dotfilesPath) and set it from each profile: nix/host.nix -> $HOME/dotfiles nix/vm.nix -> $HOME/.local/share/dotfiles common.nix now wraps its config in 'config = { ... }' so the options can sit alongside. - dockerfile-language-server-nodejs was renamed in nixpkgs to dockerfile-language-server; pick up the new name to silence the evaluation warning (the rename will eventually become a hard error).
-rw-r--r--nix/common.nix20
-rw-r--r--nix/host.nix5
-rw-r--r--nix/vm.nix3
3 files changed, 26 insertions, 2 deletions
diff --git a/nix/common.nix b/nix/common.nix
index 217d335..a34dfba 100644
--- a/nix/common.nix
+++ b/nix/common.nix
@@ -5,6 +5,10 @@
# host and the Ubuntu remote-dev VM. Profile-specific extras live in
# `host.nix` and `vm.nix`.
#
+# The path to the runtime dotfiles checkout (where symlinks point) is
+# read from `config.my.dotfilesPath`; the per-profile module sets it
+# (host: ~/dotfiles, vm: ~/.local/share/dotfiles).
+#
# Policy: this profile carries leaf CLI tools, editor/AI-agent runtimes
# (node, uv), and build *orchestrators* (cmake, ninja, ccache, sccache).
# It must NEVER carry actual compilers or linkers — those would shadow
@@ -27,10 +31,21 @@
# system python3).
let
- dotfiles = "${config.home.homeDirectory}/.local/share/dotfiles";
+ dotfiles = config.my.dotfilesPath;
link = path: config.lib.file.mkOutOfStoreSymlink "${dotfiles}/${path}";
in
{
+ options.my.dotfilesPath = lib.mkOption {
+ type = lib.types.str;
+ description = ''
+ Absolute path to the runtime dotfiles checkout that the
+ mkOutOfStoreSymlink-based home.file entries point at. The host
+ profile sets this to "$HOME/dotfiles"; the vm profile sets it
+ to "$HOME/.local/share/dotfiles".
+ '';
+ };
+
+ config = {
home.stateVersion = "25.05";
# ── Packages ────────────────────────────────────────────────────────────────
@@ -148,7 +163,7 @@ in
autotools-language-server
basedpyright
bash-language-server
- dockerfile-language-server-nodejs
+ dockerfile-language-server
just-lsp
lua-language-server
neocmakelsp
@@ -250,4 +265,5 @@ in
# ── Enable HM-managed activation messages ──────────────────────────────────
programs.home-manager.enable = true;
+ };
}
diff --git a/nix/host.nix b/nix/host.nix
index 7d81ffe..d589002 100644
--- a/nix/host.nix
+++ b/nix/host.nix
@@ -9,6 +9,11 @@
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
diff --git a/nix/vm.nix b/nix/vm.nix
index 7445b7b..257436e 100644
--- a/nix/vm.nix
+++ b/nix/vm.nix
@@ -10,6 +10,9 @@
home.username = builtins.getEnv "USER";
home.homeDirectory = builtins.getEnv "HOME";
+ # Remote-dev VM clones the dotfiles tree under XDG_DATA_HOME.
+ my.dotfilesPath = "${builtins.getEnv "HOME"}/.local/share/dotfiles";
+
home.sessionVariables = {
# Ubuntu 20.04-derived hosts still default to cgroups v1; podman 5
# warns on every invocation. Flipping to v2 is a host-level reboot