improve hacking.md a bit #146

closed
opened by gwen.works targeting master

add some more instructions around knotserver stuff, especially getting to a state where you have a repo to play with in your dev environment

todo also: mention nixwsl maybe

Changed files
+23 -8
docs
+23 -8
docs/hacking.md
··· 24 24 25 25 ```bash 26 26 TANGLED_DEV=true nix run .#watch-appview 27 + ``` 28 + 29 + > **Note:** TANGLED_DB_PATH might be of interest to point to 27 30 28 - # TANGLED_DB_PATH might be of interest to point to 29 - # different sqlite DBs 31 + In a separate shell, you can live-reload tailwind: 30 32 31 - # in a separate shell, you can live-reload tailwind 33 + ```bash 32 34 nix run .#watch-tailwind 33 35 ``` 34 36 ··· 39 41 quite cumbersome and so the nix flake provides a 40 42 `nixosConfiguration` to do so. 41 43 42 - To begin, head to `http://localhost:3000` in the browser and 44 + To begin, head to `http://localhost:3000/knots` in the browser and 43 45 generate a knotserver secret. Replace the existing secret in 44 - `flake.nix` with the newly generated secret. 46 + `flake.nix` with the newly generated secret, look for `KNOT_SERVER_SECRET=...`. 45 47 46 48 You can now start a lightweight NixOS VM using 47 49 `nixos-shell` like so: ··· 53 55 ``` 54 56 55 57 This starts a knotserver on port 6000 with `ssh` exposed on 56 - port 2222. You can push repositories to this VM with this 57 - ssh config block on your main machine: 58 + port 2222. 59 + 60 + while the VM is booting up, you can set up a ssh identity and git remote to push something to your local knotserver. 61 + 62 + Make youself a SSH keypair: 63 + 64 + ```bash 65 + ssh-keygen -f ~/.ssh/my_tangled_key 66 + ``` 67 + 68 + Add the public key to your account: http://localhost:3000/settings, and declare the host in your SSH config (typically at `~/.ssh/config`): 58 69 59 70 ```bash 60 71 Host nixos-shell ··· 64 75 IdentityFile ~/.ssh/my_tangled_key 65 76 ``` 66 77 67 - Set up a remote called `local-dev` on a git repo: 78 + Then, once the knotserver is up, you can go to http://localhost:3000/knots and click <kbd>Initialize</kbd>. 79 + 80 + You can then create a repo at http://localhost:3000/repo/new. Choose your local knot (localhost:6000). 81 + 82 + Set up a remote called `local-dev` on a git repo, then push to it: 68 83 69 84 ```bash 70 85 git remote add local-dev git@nixos-shell:user/repo