Skip to content

Commit e200120

Browse files
committed
docs: add precisions on how to setup a device and a sample config file
1 parent 144ab9c commit e200120

File tree

3 files changed

+41
-10
lines changed

3 files changed

+41
-10
lines changed

README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,30 @@ software! Please read `docs/README.txt` at the very least!
1515

1616
## Development Notes
1717

18-
Do not forget to run `pre-commit install` to get the formatting hooks running
19-
before contributing!
18+
To setup navi you'll first need to bootstrap it:
19+
20+
```
21+
cd bootstrap && ./bootstrap.sh
22+
```
23+
This will setup secrets needed for the entire infrastructure to work.
24+
2025

21-
For security reasons, you will want to set git pull path to https and git push
22-
patch to ssh, obviously this is only useful if you actually develop navi.
26+
If you want to test the setup before installing it on a real machine you can
2327

24-
To do that run the following commands, using my own repository as an example:
25-
```sh
26-
git remote set-url origin https://code.govanify.com/govanify/navi.git
27-
git remote set-url origin --push [email protected]:govanify/navi.git
2828
```
29+
sudo nixos-rebuild build-vm -I nixos-config=./configuration.sample.nix
30+
```
31+
32+
If you want to install navi on a live machine, you'll need to run the
33+
bootstrapper again to generate device-specific keys, paths, and other required
34+
components. It will generate a default configuration which you should tailor to
35+
your needs. Installing is then as simple as running
36+
37+
```
38+
sudo nixos-install
39+
```
40+
41+
## Contributing
42+
43+
Do not forget to run `pre-commit install` to get the formatting hooks running
44+
before contributing!

bootstrap/bootstrap.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,18 @@ export GNUPGHOME=$old_gpg_home
221221
rm -rf /mnt/etc/nixos
222222
# should i make this url configurable?
223223
git clone https://code.govanify.com/govanify/navi /mnt/etc/nixos
224+
cd /mnt/etc/nixos
225+
git remote set-url origin --push [email protected]:govanify/navi.git
224226
nixos-generate-config --root /mnt
227+
rm -rf configuration.nix
228+
cp -rf configuration.sample.nix configuration.nix
225229
} > /dev/null 2>&1
226230

227231
# in lieu of fully automating everything let's, for now, do an echo for when i
228232
# have the time to setup something better
229233
printf "\n\nDone! Make sure to setup nixpkgs and home-manager channels\n"
230234
printf "and then configure your device correctly! Look at infrastructure/\n"
231-
printf "for examples. For luks devices you'll need to set the path to your\n"
232-
printf "keyfile (found in /etc/secrets/initrd)."
235+
printf "for examples. To help you, a hardware.nix file has been auto-generated\n"
236+
printf "but it will possibly require manual intervention. For example, luks\n"
237+
printf "devices will need the path to their keyfile set\n"
238+
printf "(found in /etc/secrets/initrd)."

configuration.sample.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{ config, pkgs, lib, ... }:
2+
{
3+
imports =
4+
[
5+
./default.nix
6+
];
7+
8+
navi.device = "xanadu";
9+
}

0 commit comments

Comments
 (0)