Commit graph

42 commits

Author SHA1 Message Date
Sridhar Ratnakumar
776c4425b0 incus-pet: shared /nix/store, restart-to-deploy, drop anywhen flake input
The incus-pet CLI gains three big changes that together cut per-container
disk usage by ~5GB, drop nix-rebuild + nix-copy from the deploy path, and
make `deploy` actually pull latest on every invocation. anywhen migrates
from a host-installed service to an incus-pet container in the process.

* Shared /nix/store mount. Each container gets host's /nix/store
  bind-mounted read-only (with shift=true for idmapped unprivileged
  containers). Zero per-container duplication of nixpkgs closures. The
  CLI builds toplevels on the host; the container sees them via the
  shared mount, no `nix copy` needed.

* Restart-to-deploy. switch-to-configuration is removed entirely (it
  was stalling on dbus-broker reload and hitting the same lock-
  contention bug across redeploys). New activation: update
  /nix/var/nix/profiles/system, repoint /sbin/init through the profile
  symlink, `incus restart`. The new toplevel's own init script handles
  /etc setup on boot. Trade-off: ~5s of container reboot per deploy.

* Marshaling flake exposes only nixosModules.default. No nixpkgs
  input, no nixosConfigurations entry. The CLI picks nixpkgs at build
  time (pinned to nixos-25.11 — matches the LXC image baseline, dodges
  unstable regressions) and assembles the full nixosSystem via
  `nix build --impure --expr`. Lets us bump nixpkgs without touching
  per-deploy state.

* `nix flake update --refresh` on every deploy. Was `nix flake lock`,
  which only locks first-seen inputs — re-deploying `github:srid/anywhen`
  stayed pinned at the first commit ever resolved. Now every deploy
  bumps the target input to the current tip of its ref and bypasses
  nix's fetcher cache.

* /sbin/init repoint. The NixOS LXC image hard-links /sbin/init to its
  own toplevel's init path. Without switch-to-configuration, `incus
  restart` re-execs that old init, which sets up /etc from the old
  toplevel — running services keep using the OLD anywhen binary even
  though the profile pointer moved. CLI now also does
  `ln -sfn /nix/var/nix/profiles/system/init /sbin/init` so the profile
  actually drives boot. Idempotent.

* Host gcroot via `nix-store --add-root --indirect`. Container's nix DB
  doesn't know about the path (it lives behind the shared mount), so
  without a host-side gcroot the host could nix-collect-garbage the
  running system out from under the container. Symlink at
  ~/.local/state/incus-pet/<name>/system. Only the LATEST toplevel is
  pinned per app — no rollback today (file a 5-line ring buffer when
  rollback matters).

* anywhen flake input removed. `modules/nixos/linux/anywhen.nix` is
  gone; the host config no longer imports anywhen as a flake input.
  The deploy command takes the flake ref as an argument, so locking it
  here was just bloat. `just pureintent anywhen-deploy` runs the
  current invocation.

* pureintent ops recipes. New `configurations/nixos/pureintent/mod.just`
  with anywhen-{deploy,rm,backup,restore,status,shell}. Namespaced via
  `mod pureintent` so each host's recipes live behind their own prefix.

* Drop ssh from deploy path. Bootstrap still pushes the operator's
  pubkey (for interactive debugging), but activation goes through
  `incus exec` exclusively. No NIX_SSHOPTS, no nix-copy-via-ssh,
  no host-key TOFU dance during deploys.

Tested end-to-end on pureintent: anywhen migrated from host-installed
(21-task SQLite DB at /var/lib/anywhen) to an incus-pet container with
the DB intact; hello-web deployed fresh with shared /nix/store; both
serve over the tailscale proxy at 100.122.32.106:{6111,8081}; lock
bumps + new toplevels confirmed after master advances.
2026-05-23 18:50:10 -04:00
Sridhar Ratnakumar
434202d1ed fuck pc for now 2026-03-14 09:16:34 -04:00
Sridhar Ratnakumar
23fc0ec9a2 a 2025-11-01 14:41:34 -04:00
Sridhar Ratnakumar
0c6a50ebe1 justfile: refactor 2025-07-26 17:37:39 -04:00
Sridhar Ratnakumar
7d94ff2ab7 Add vertex 2025-07-26 12:21:47 -04:00
Sridhar Ratnakumar
4ebcb2b860 Simplify justfile 2025-07-26 10:52:12 -04:00
Sridhar Ratnakumar
e79eb45efa "just activate" 2025-07-25 15:16:06 -04:00
Sridhar Ratnakumar
ba090bc142 Use explicit hostname 2025-07-25 15:13:57 -04:00
Sridhar Ratnakumar
9cd05ba8d4 Update justfile 2025-07-22 10:30:42 -04:00
Sridhar Ratnakumar
d7a9c94cf5 justfile: ssh to tart 2025-07-21 12:01:39 -04:00
Sridhar Ratnakumar
f61cbdbd52
Add configuration for Tart VM (#92) 2025-07-20 22:40:04 -04:00
Sridhar Ratnakumar
13c5525696 Add orbstack config (uses 'nixos' hostname) 2025-06-15 13:30:27 +10:00
Sridhar Ratnakumar
ba4ea2db74 nix: Update primary inputs 2025-03-22 13:48:07 -04:00
Sridhar Ratnakumar
8b6647d007 just: remove nom 2025-03-06 10:17:40 -05:00
Sridhar Ratnakumar
1b145e777b Update omnix, and ditch treefmt 2025-02-09 10:01:15 -05:00
Sridhar Ratnakumar
40b9030d94 naivete: mac mini no more 2025-02-03 18:30:38 -05:00
Sridhar Ratnakumar
a883d43583 nom 2025-01-27 11:28:25 -05:00
Sridhar Ratnakumar
90436d0b8e Add mac mini server 2025-01-18 13:15:07 -05:00
Sridhar Ratnakumar
5e28174601 infinitude: Initialize
Macbook Pro as headless machine.
2025-01-10 15:07:13 -05:00
Sridhar Ratnakumar
47a0df1eab just: boot cleaning 2024-12-16 14:19:34 -05:00
Sridhar Ratnakumar
4ee5b89695 doom: avoid rebuild 2024-11-27 13:57:10 -05:00
Sridhar Ratnakumar
eff3333e3d
add gate 2024-11-19 16:50:26 -05:00
Sridhar Ratnakumar
2422448c3f
treefmt: gg 2024-11-19 15:49:55 -05:00
Sridhar Ratnakumar
aaee9c379b
fix justfile 2024-11-17 08:56:09 -05:00
Sridhar Ratnakumar
aa58393c5b
Update nixos-flake 2024-06-26 17:25:20 -04:00
Sridhar Ratnakumar
2a221733c3
Update nixos-flake 2024-06-25 22:23:38 -04:00
Sridhar Ratnakumar
4d29a310ea Remove clusters/github-runner
New module upcoming ...
2024-06-21 19:39:06 -04:00
Sridhar Ratnakumar
70afdfade5 chore: just, better grouping 2024-05-27 17:16:55 -04:00
Sridhar Ratnakumar
c6efa50e65 Use newer version of just
until it is upgraded in nixpkgs, like:

https://github.com/NixOS/nixpkgs/pull/311583
2024-05-26 15:32:14 -04:00
Sridhar Ratnakumar
ae2b27c138 chore(just): improve for github-runner 2024-05-26 11:13:08 -04:00
Sridhar Ratnakumar
9ff9061340 chore(just): add 'activate' 2024-05-15 22:39:49 -04:00
Sridhar Ratnakumar
3b7f981ec7 just: fix gr-animate, try to 2024-04-03 10:48:11 +11:00
Sridhar Ratnakumar
6c1a454e21 just: add gr-animate
re-animates the suspended VM
2024-04-02 17:43:53 +11:00
Sridhar Ratnakumar
e2d7def990 So long, sops. 2024-03-26 17:24:37 -04:00
Sridhar Ratnakumar
cda20a3348 justfile: new deploy 2024-03-26 17:11:18 -04:00
Sridhar Ratnakumar
bdba0619ac
Update nix-darwin for latest github-runner; refactor, following a fresh install (#51) 2024-03-24 19:37:44 -04:00
Sridhar Ratnakumar
174eec2b78 just: sops commands 2024-03-01 12:41:45 -05:00
Sridhar Ratnakumar
99818845b3 add treefmt to devShell 2024-02-25 08:32:33 -05:00
Sridhar Ratnakumar
6ba1455928 just: add fmt 2024-02-24 17:50:14 -05:00
Sridhar Ratnakumar
fdc657190f
Add a plain linux-builder configuration for Parallels VM (#47) 2024-02-24 13:14:17 -05:00
Sridhar Ratnakumar
17bc071edf just: enrich that one target 2024-02-20 16:30:30 -05:00
Sridhar Ratnakumar
fac4275980 Add 'here' VM
And justfile as well
2024-02-20 16:24:40 -05:00