@@ -60,6 +60,28 @@ Or to launch ghcid for `lib/command` project:
6060nix-shell -A obeliskEnvs.obelisk-command --run "cd lib/command && ghcid -c 'cabal new-repl'"
6161```
6262
63+To re-install `ob` from source do
64+```
65+nix-env -f /path/to/obelisk -iA command
66+```
67+
68+Note that `ob` will defer to the version found in your project's `.obelisk/impl` directory. To update that version specifically:
69+
70+```shell
71+ob thunk unpack ./obelisk/impl
72+cd ./obelisk/impl
73+# apply your changes
74+```
75+
76+If you want to commit your changes, first push them to your fork of obelisk and then
77+
78+```shell
79+cd /your/project/root
80+ob thunk pack .obelisk/impl
81+git add .obelisk/impl
82+git commit -m "Bump obelisk"
83+```
84+
6385### Accessing private repositories
6486
6587To allow the Nix builder to access private git repositories, you must be set up
@@ -99,14 +121,14 @@ In order to add package dependencies, declare them under the build-depends field
99121
100122### Adding package overrides
101123
102−To add a version override to any Haskell package, or to add a Haskell package that doesn't exist in the nixpkgs used by Obelisk, use the `overrides` attribute in your project's `default.nix`. For example, to use a specific version of the `aeson` package, your `default.nix` will look like:
124+To add a version override to any Haskell package, or to add a Haskell package that doesn't exist in the nixpkgs used by Obelisk, use the `overrides` attribute in your project's `default.nix`. For example, to use a specific version of the `aeson` package fetched from GitHub and a specific version of the `waargonaut` package fetched from Hackage, your `default.nix` will look like:
103125
104126```nix
105127# ...
106128project ./. ({ pkgs, ... }: {
107129# ...
108130 overrides = self: super: let
109− aeson = pkgs.fetchFromGitHub {
131+ aesonSrc = pkgs.fetchFromGitHub {
110132 owner = "obsidiansystems";
111133 repo = "aeson-gadt-th";
112134 rev = "ed573c2cccf54d72aa6279026752a3fecf9c1383";
@@ -114,7 +136,12 @@ project ./. ({ pkgs, ... }: {
114136 };
115137 in
116138 {
117− aeson = self.callCabal2nix "aeson" aeson {};
139+ aeson = self.callCabal2nix "aeson" aesonSrc {};
140+ waargonaut = self.callHackageDirect {
141+ pkg = "waargonaut";
142+ ver = "0.8.0.1";
143+ sha256 = "1zv28np3k3hg378vqm89v802xr0g8cwk7gy3mr77xrzy5jbgpa39";
144+ } {};
118145 };
119146# ...
120147```
@@ -145,14 +172,16 @@ project ./. ({ pkgs, ... }: {
145172Build everything:
146173
147174```
148−nix-build -A exe -o result-exe
175+nix-build -A exe --no-out-link
149176```
150177
151−Run the server:
178+Copy the result to a new directory, add configuration, and run!
152179
153180```
154−cd result-exe
155−./backend
181+mkdir test-app
182+ln -s $(nix-build -A exe --no-out-link)/* test-app/
183+cp -r config test-app
184+(cd test-app && ./backend)
156185```
157186
158187### EC2
@@ -184,9 +213,11 @@ ob deploy init \
184213 ~/code/myapp-deploy
185214```
186215
187−NOTE: HTTPS is enabled by default; to disable https, pass `--disable-https` to the `ob deploy init` command above.
216+HTTPS is enabled by default; to disable https, pass `--disable-https` to the `ob deploy init` command above.
217+
218+This step will also require that you manually verify the authenticity of the host `$SERVER`. Obelisk will save the fingerprint in a deployment-specific configuration. **Obelisk deployments do *not* rely on the `known_hosts` of your local machine.** This is because, in the event that you need to switch from one deploy machine / bastion host to another, you want to be absolutely sure that you're still connecting to the machines you think you are, even if that deploy machine / bastion host has never connected to them before. Obelisk explicitly avoids a workflow that encourages people to accept host keys without checking them, since that could result in leaking production secrets to anyone who manages to MITM you, e.g. via DNS spoofing or cache poisoning. (Note that an active attack is a circumstance where you may need to quickly switch bastion hosts, e.g. because the attacker has taken one down or you have taken it down in case it was compromised. In this circumstance you might need to deploy to production to fix an exploit or rotate keys, etc.) When you run `ob deploy` later it will rely on the saved verification in this step.
188219
189−Then go to that created deployment configuration directory, and initiate the deployment:
220+Next, go to the deployment directory that you just initialized and deploy!
190221
191222```
192223cd ~/code/myapp-deploy