···
51
+
## running knots and spindles in a VM
An end-to-end knot setup requires setting up a machine with
`sshd`, `AuthorizedKeysCommand`, and git user, which is
quite cumbersome. So the nix flake provides a
`nixosConfiguration` to do so.
58
+
### Mac-specific: setting up a Nix builder
60
+
In order to build Tangled's dev VM on macOS, you will first need to set up a
61
+
Linux Nix builder. The recommended way to do so is to run a
62
+
[`darwin.linux-builder` VM][darwin builder vm] and to register it in `nix.conf`
63
+
as a builder for Linux with the same architecture as your Mac (`linux-aarch64`
64
+
if you are using Apple Silicon).
66
+
> IMPORTANT: You must build `darwin.linux-builder` somewhere other than inside
67
+
> the tangled repo so that it doesn't conflict with the other VM. For example,
71
+
> cd $(mktemp -d buildervm.XXXXX) && nix run nixpkgs#darwin.linux-builder
74
+
> to store the builder VM in a temporary dir.
76
+
> You should read and follow [all the other intructions][darwin builder vm] to
77
+
> avoid subtle problems.
79
+
Alternatively, you can use any other method to set up a Linux machine with `nix`
80
+
installed that you can `sudo ssh` into (in other words, root user on your Mac
81
+
has to be able to ssh into the Linux machine without entering a password) and
82
+
that has the same architecture as your Mac. See [remote builder instructions]
83
+
for how to register such a builder in `nix.conf`.
85
+
> WARNING: If you'd like to use
86
+
> [`nixos-lima`](https://github.com/nixos-lima/nixos-lima) or
87
+
> [Orbstack](https://orbstack.dev/), note that setting them up so that `sudo
88
+
> ssh` works can be tricky. It seems to be [possible with
89
+
> Orbstack](https://github.com/orgs/orbstack/discussions/1669).
91
+
[darwin builder vm]:
92
+
https://nixos.org/manual/nixpkgs/unstable/#sec-darwin-builder
93
+
[remote builder instructions]:
94
+
https://nix.dev/manual/nix/2.28/advanced-topics/distributed-builds.html#requirements
96
+
### Running a knot on a dev VM
To begin, grab your DID from http://localhost:3000/settings.
Then, set `TANGLED_VM_KNOT_OWNER` and
`TANGLED_VM_SPINDLE_OWNER` to your DID.
···
100
-
## running a spindle
140
+
### running a spindle
The above VM should already be running a spindle on
`localhost:6555`. Head to http://localhost:3000/spindles and