authoravatarclover caruso<git@paperclover.net>2026-11-01 22:19:03-08:00
committeravatarclover caruso<git@paperclover.net>2026-11-12 16:08:55-08:00
logffc3896c9d5ee7c48a19bfa615c002d2c9de7077
tree4d4cebee9fb435308f551d101b6338d1360dd040
parent200d5a28438846413d0e4a2d201b6d6bb440de04
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Restore the /work export and its guest mount

The workspace SSD share lived only in a divergent copy of the workspace SSD change, so every deploy after Oct 29 dropped the bind of /srv/work onto the sandbox .work directory. The guest then mounted the empty directory and the mount daemon trusted it. Bind the pool again with its export and pool check, and have the guest daemon verify the SSD marker on every tick. Assisted-by: claude-sonnet-5.5

3 files changed, 46 insertions(+), 0 deletions(-)

guest/net.paperclover.work-share.plist created+19
......@@ -0,0 +1,19 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>Label</key>
6 <string>net.paperclover.work-share</string>
7 <key>ProgramArguments</key>
8 <array>
9 <string>/bin/sh</string>
10 <string>-c</string>
11<string>/sbin/mount | /usr/bin/grep -Fq ' on /work (' || /sbin/mount -t nfs -o rw,vers=4,tcp,noresvport,retrycnt=0,intr,sec=sys,nocallback,noowners,rsize=1048576,wsize=1048576,readahead=16,noatime,nosuid,nodev 10.0.0.1:/.work /work || exit 1
12/bin/test -f /work/.snowglobe-work || { /sbin/umount -f /work; exit 1; }</string>
13 </array>
14 <key>RunAtLoad</key>
15 <true/>
16 <key>StartInterval</key>
17 <integer>30</integer>
18</dict>
19</plist>
nixos/mac-studio-sandbox.nix+21
......@@ -53,6 +53,27 @@ in
5353 ${mountPoint} ${workspace.clientAddress}(rw,sync,fsid=0,no_subtree_check,all_squash,anonuid=${toString config.users.users.clo.uid},anongid=${toString config.users.groups.chloe.gid},insecure)
5454 '';
5555 };
56 environment.etc."exports.d/snowglobe-work.exports".text = ''
57 ${mountPoint}/.work ${workspace.clientAddress}(rw,sync,fsid=42,no_subtree_check,all_squash,anonuid=${toString config.users.users.clo.uid},anongid=${toString config.users.groups.chloe.gid},insecure)
58 '';
59 systemd.services.mac-work-share-check = {
60 requires = [ "zfs-import-work.service" ];
61 after = [ "zfs-import-work.service" "zfs-mount.service" ];
62 serviceConfig = { Type = "oneshot"; RemainAfterExit = true; };
63 script = ''
64 test "$(${pkgs.util-linux}/bin/findmnt -n -o SOURCE --mountpoint /srv/work)" = work
65 '';
66 };
67 systemd.mounts = [{
68 what = "/srv/work";
69 where = "${mountPoint}/.work";
70 type = "none";
71 options = "bind";
72 requires = [ "mac-work-share-check.service" "mac-studio-sandbox.service" ];
73 after = [ "mac-work-share-check.service" "mac-studio-sandbox.service" ];
74 before = [ "nfs-server.service" ];
75 wantedBy = [ "multi-user.target" ];
76 }];
5677 services.nfs.settings.nfsd = {
5778 vers3 = false;
5879 "vers4.0" = true;
tools/mac-agent-vm.md+6
......@@ -169,6 +169,12 @@ VM address each time and reuses the existing pinned key configuration.
169169The guest mounts Snow Globe’s NFS export at `/Volumes/Code` using `/etc/fstab`.
170170[net.paperclover.code-share.plist](../guest/net.paperclover.code-share.plist)
171171runs as a system LaunchDaemon at boot and retries every 30 seconds if needed.
172The workspace SSD is mounted at `/work` through a separate NFS export, bound
173on Snow Globe from `/srv/work` onto the sandbox's `.work` directory;
174`/etc/synthetic.d/snowglobe-work` creates the mount point and
175[net.paperclover.work-share.plist](../guest/net.paperclover.work-share.plist)
176retries the mount every 30 seconds and unmounts it again unless the SSD marker
177is present.
172178
173179The guest's `/etc/hosts` maps `file.paperclover.net` to the NAS LAN address
174180`10.0.0.1`. Traffic uses the VM's NAT gateway `192.168.64.1`; the host's hosts