diff --git a/docs/hacking.md b/docs/hacking.md index 265c930..2c3ba54 100644 --- a/docs/hacking.md +++ b/docs/hacking.md @@ -24,11 +24,13 @@ live-reloader: ```bash TANGLED_DEV=true nix run .#watch-appview +``` + +> **Note:** TANGLED_DB_PATH might be of interest to point to -# TANGLED_DB_PATH might be of interest to point to -# different sqlite DBs +In a separate shell, you can live-reload tailwind: -# in a separate shell, you can live-reload tailwind +```bash nix run .#watch-tailwind ``` @@ -39,9 +41,9 @@ with `sshd`, `repoguard`, `keyfetch`, a git user, which is quite cumbersome and so the nix flake provides a `nixosConfiguration` to do so. -To begin, head to `http://localhost:3000` in the browser and +To begin, head to `http://localhost:3000/knots` in the browser and generate a knotserver secret. Replace the existing secret in -`flake.nix` with the newly generated secret. +`flake.nix` with the newly generated secret, look for `KNOT_SERVER_SECRET=...`. You can now start a lightweight NixOS VM using `nixos-shell` like so: @@ -53,8 +55,17 @@ QEMU_NET_OPTS="hostfwd=tcp::6000-:6000,hostfwd=tcp::2222-:22" nixos-shell --flak ``` This starts a knotserver on port 6000 with `ssh` exposed on -port 2222. You can push repositories to this VM with this -ssh config block on your main machine: +port 2222. + +while the VM is booting up, you can set up a ssh identity and git remote to push something to your local knotserver. + +Make youself a SSH keypair: + +```bash +ssh-keygen -f ~/.ssh/my_tangled_key +``` + +Add the public key to your account: http://localhost:3000/settings, and declare the host in your SSH config (typically at `~/.ssh/config`): ```bash Host nixos-shell @@ -64,7 +75,11 @@ Host nixos-shell IdentityFile ~/.ssh/my_tangled_key ``` -Set up a remote called `local-dev` on a git repo: +Then, once the knotserver is up, you can go to http://localhost:3000/knots and click Initialize. + +You can then create a repo at http://localhost:3000/repo/new. Choose your local knot (localhost:6000). + +Set up a remote called `local-dev` on a git repo, then push to it: ```bash git remote add local-dev git@nixos-shell:user/repo