From 7fc45ae0b8224ca437b3b71b1b9cc033193dd65c Mon Sep 17 00:00:00 2001 From: nevaforget <> Date: Wed, 23 Sep 2026 13:14:30 +0200 Subject: [PATCH] fix(thinkpad): ready the host for its first install The host still carried snapper, which the desktop dropped in d3cc03c: disk.nix creates no .snapshots subvolumes, so the timer would fail every hour without ever taking a snapshot. The account sat in the docker group while docker itself was off, and stateVersion named 26.05 although the machine is first installed on 26.11. Also drops the stale snapper mentions elsewhere and adds git-firefly to Zed's auto-installed extensions. --- DECISIONS.md | 7 +++++++ README.md | 2 +- hosts/thinkpad/default.nix | 34 +++++++++++++--------------------- modules/disk.nix | 4 ++-- modules/user.nix | 6 +++--- modules/zed.nix | 1 + 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/DECISIONS.md b/DECISIONS.md index 6daff05..6bc448c 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -1,5 +1,12 @@ # Decisions +## 2026-09-23 – ThinkPad host reviewed before its first install + +- **Who**: Dominik, ClaudeCode +- **Why**: The ThinkPad moves from Arch to NixOS, and its host file had not been built since the desktop went through the same review. Three things were wrong for a first install: (1) it still carried the snapper configs the desktop dropped in `a04fa91` — `modules/disk.nix` creates no `.snapshots` subvolumes, so snapper-timeline would fail every hour and never take a snapshot; (2) the account is listed in the `docker` group, but `virtualisation.docker.enable` was off, so neither dockerd nor the group existed, and the work projects on this machine run their services in containers; (3) `stateVersion` was `26.05` while nixpkgs is `26.11`, the release the machine is actually first installed with. +- **Tradeoffs**: snapper was removed rather than repaired, for the reasons in `a04fa91`: generations cover rollbacks of `/`, and `/home` snapshots on the same disk do not survive the disk. `plugdev` stays in `extraGroups` although no such group exists — it is a leftover of an old corsair udev rule, harmless, and not part of this change. +- **How**: `hosts/thinkpad/default.nix` drops `services.snapper`, enables `virtualisation.docker`, sets `stateVersion = "26.11"`. The stale snapper mentions in `modules/user.nix`, `modules/disk.nix` and `README.md` are rewritten. `git-firefly` joins Zed's `auto_install_extensions`, matching the extensions installed on the Arch side. Verified with `nix build` of the thinkpad and desktop toplevels. + ## 2026-09-14 – moonarch-lock follows moonarch; the wrapper needs a PATH of its own - **Who**: Dominik, ClaudeCode diff --git a/README.md b/README.md index 25a6de6..3989725 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ the disk may enumerate differently next time. ``` Set the login name in the same file. `moonarch.user` has no default and is - read by `users.users`, the autologin session and snapper, so the name is + read by `users.users` and the autologin session, so the name is declared once per machine. 3. Add a `nixosConfigurations.` entry in `flake.nix`. 4. Install with the same `disko-install` command, with `#` and that diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index 8ac73ba..f5e36c0 100644 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -59,26 +59,16 @@ user = config.moonarch.user; }; - # Snapshots of root and home. snap-pac has no counterpart here: NixOS keeps - # its own generations, so pre/post package snapshots are redundant. - services.snapper = { - configs = { - root = { - SUBVOLUME = "/"; - ALLOW_USERS = [ config.moonarch.user ]; - TIMELINE_CREATE = true; - TIMELINE_CLEANUP = true; - }; - home = { - SUBVOLUME = "/home"; - ALLOW_USERS = [ config.moonarch.user ]; - TIMELINE_CREATE = true; - TIMELINE_CLEANUP = true; - }; - }; - snapshotInterval = "hourly"; - cleanupInterval = "1d"; - }; + # No snapper here, for the reason the desktop dropped it: the module writes + # the configs and the timers, but modules/disk.nix creates no .snapshots + # subvolumes, so snapper-timeline would fail every hour with errno:2 and never + # take a snapshot. Rollbacks of / are covered by NixOS generations, and + # snapshots of /home on the same disk do not survive the disk. + + # Work projects run their databases and services in containers. The module, + # not the package: it runs dockerd and creates the docker group the account + # is listed in above, which does not exist otherwise. + virtualisation.docker.enable = true; # The nixos-hardware profile only sets hardware.cpu.amd.updateMicrocode as a # default derived from this option, so without it there is neither a microcode @@ -95,5 +85,7 @@ nix.settings.experimental-features = [ "nix-command" "flakes" ]; nixpkgs.config.allowUnfree = true; - system.stateVersion = "26.05"; + # The release this machine is first installed with. It stays at this value + # for the life of the installation and is never raised by an update. + system.stateVersion = "26.11"; } diff --git a/modules/disk.nix b/modules/disk.nix index ccf1f45..e40c119 100644 --- a/modules/disk.nix +++ b/modules/disk.nix @@ -10,8 +10,8 @@ let systemSubvolumes = { "/root" = { mountpoint = "/"; inherit mountOptions; }; - # Separate so the store stays out of the snapper snapshots of /. It is - # reproducible from the flake and would only inflate them. + # Separate so a snapshot or copy of / leaves the store out. It is + # reproducible from the flake and would only inflate either. "/nix" = { mountpoint = "/nix"; inherit mountOptions; }; } // lib.optionalAttrs (!cfg.home.enable) { # Only here when there is no second disk. With one, /home lives over there diff --git a/modules/user.nix b/modules/user.nix index 591fcd9..0b5c707 100644 --- a/modules/user.nix +++ b/modules/user.nix @@ -1,5 +1,5 @@ # ABOUTME: Declares the moonarch.user option; every host sets its own login name. -# ABOUTME: Autologin, group membership and snapper read moonarch.user from here. +# ABOUTME: Autologin and group membership read moonarch.user from here. { lib, ... }: @@ -9,8 +9,8 @@ example = "moon"; description = '' Login name of the primary account, and therefore the directory name under - /home. Autologin, the group memberships and snapper's ALLOW_USERS all read - this, so the name is declared once instead of once per reference. + /home. Autologin and the group memberships both read this, so the name is + declared once instead of once per reference. There is no default: the name belongs to the machine, so every host sets it. Changing it on an installed system does not rename the home directory — diff --git a/modules/zed.nix b/modules/zed.nix index 254eff8..8995fe7 100644 --- a/modules/zed.nix +++ b/modules/zed.nix @@ -69,6 +69,7 @@ let "auto_install_extensions": { "catppuccin": true, "dockerfile": true, + "git-firefly": true, "html": true, "log": true, "nix": true,