| author | |
| committer | |
| log | ffc3896c9d5ee7c48a19bfa615c002d2c9de7077 |
| tree | 4d4cebee9fb435308f551d101b6338d1360dd040 |
| parent | 200d5a28438846413d0e4a2d201b6d6bb440de04 |
| signature | Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU |
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.53 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 | ... | @@ -53,6 +53,27 @@ in |
| 53 | ${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) | 53 | ${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) |
| 54 | ''; | 54 | ''; |
| 55 | }; | 55 | }; |
| 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 | }]; | ||
| 56 | services.nfs.settings.nfsd = { | 77 | services.nfs.settings.nfsd = { |
| 57 | vers3 = false; | 78 | vers3 = false; |
| 58 | "vers4.0" = true; | 79 | "vers4.0" = true; |
tools/mac-agent-vm.md+6| ... | @@ -169,6 +169,12 @@ VM address each time and reuses the existing pinned key configuration. | ... | @@ -169,6 +169,12 @@ VM address each time and reuses the existing pinned key configuration. |
| 169 | The guest mounts Snow Globe’s NFS export at `/Volumes/Code` using `/etc/fstab`. | 169 | The guest mounts Snow Globe’s NFS export at `/Volumes/Code` using `/etc/fstab`. |
| 170 | [net.paperclover.code-share.plist](../guest/net.paperclover.code-share.plist) | 170 | [net.paperclover.code-share.plist](../guest/net.paperclover.code-share.plist) |
| 171 | runs as a system LaunchDaemon at boot and retries every 30 seconds if needed. | 171 | runs as a system LaunchDaemon at boot and retries every 30 seconds if needed. |
| 172 | The workspace SSD is mounted at `/work` through a separate NFS export, bound | ||
| 173 | on 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) | ||
| 176 | retries the mount every 30 seconds and unmounts it again unless the SSD marker | ||
| 177 | is present. | ||
| 172 | 178 | ||
| 173 | The guest's `/etc/hosts` maps `file.paperclover.net` to the NAS LAN address | 179 | The guest's `/etc/hosts` maps `file.paperclover.net` to the NAS LAN address |
| 174 | `10.0.0.1`. Traffic uses the VM's NAT gateway `192.168.64.1`; the host's hosts | 180 | `10.0.0.1`. Traffic uses the VM's NAT gateway `192.168.64.1`; the host's hosts |