Skip to content

Commit b4fa347

Browse files
committed
update nix-related documentation
1 parent faf128b commit b4fa347

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

CONTRIBUTING.md

+10
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ To run
8787

8888
- Ensure JSON keys are `camelCase` rather than `snake_case`, where possible.
8989

90+
### Nix considerations
91+
92+
- If any dependencies are added or removed, the `vendorHash` property in ./flake.nix will need to be updated. To do so, run `nix build`. If it works, you're good to go. If a change is required, you'll see an error that looks like the following. Replace the `specified` value of `vendorHash` in the medusa package of flake.nix with what nix actually `got`.
93+
94+
```
95+
error: hash mismatch in fixed-output derivation '/nix/store/sfgmkr563pzyxzllpmwxdbdxgrav8y1p-medusa-0.1.8-go-modules.drv':
96+
specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
97+
got: sha256-12Xkg5dzA83HQ2gMngXoLgu1c9KGSL6ly5Qz/o8U++8=
98+
```
99+
90100
## License
91101

92102
The license for this software can be found [here](./LICENSE).

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The master branch can be installed using the following command:
4444
brew install --HEAD medusa
4545
```
4646

47-
For more information on building from source or obtaining binaries for Windows and Linux, please refer to the [installation guide](./docs/src/getting_started/installation.md).
47+
For more information on building from source, using nix, or obtaining binaries for Windows and Linux, please refer to the [installation guide](./docs/src/getting_started/installation.md).
4848

4949
## Contributing
5050

docs/src/getting_started/installation.md

+21
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,27 @@ Run the following command to install `medusa`:
2222
brew install medusa
2323
```
2424

25+
## Installing with Nix
26+
27+
### Prerequisites
28+
29+
Make sure nix is installed and that `nix-command` and `flake` features are enabled. The [Determinate Systems nix-installer](https://determinate.systems/nix-installer/) will automatically enable these features and is the recommended approach. If nix is already installed without these features enabled, run the following commands.
30+
31+
```
32+
mkdir -p ~/.config/nix
33+
echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf
34+
```
35+
36+
### Build `medusa`
37+
38+
`nix build` will build medusa and wire up independent copies of required dependencies. The resulting binary can be found at `./result/bin/medusa`
39+
40+
### Install `medusa`
41+
42+
After building, you can add the build result to your PATH using nix profiles by running the following command:
43+
44+
`nix profile install ./result`
45+
2546
## Building from source
2647

2748
### Prerequisites

0 commit comments

Comments
 (0)