2022-05-21 01:59:51 +00:00
|
|
|
to build:
|
|
|
|
```sh
|
2022-06-12 22:11:41 +00:00
|
|
|
nixos-rebuild --flake "/etc/nixos/#servo" {build,switch}
|
2022-05-21 01:59:51 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
query with:
|
|
|
|
```sh
|
|
|
|
nix flake show
|
|
|
|
```
|
2022-05-21 02:08:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
# secrets
|
2022-05-27 08:01:06 +00:00
|
|
|
|
2022-06-09 00:07:48 +00:00
|
|
|
we use [sops](https://github.com/Mic92/sops-nix) for secrets.
|
|
|
|
see helpers/universal/secrets.nix for some tips.
|
2022-05-22 01:05:32 +00:00
|
|
|
|
|
|
|
## building images
|
|
|
|
|
2022-05-22 10:14:50 +00:00
|
|
|
to build a distributable image (GPT-formatted image with rootfs and /boot partition):
|
2022-05-22 01:05:32 +00:00
|
|
|
```sh
|
2022-06-12 22:11:41 +00:00
|
|
|
nix build ./#imgs.lappy
|
2022-05-22 01:05:32 +00:00
|
|
|
```
|
2022-05-22 10:14:50 +00:00
|
|
|
this can then be `dd`'d onto a disk and directly booted from a EFI system.
|
|
|
|
there's some post-processing to do before running a rebuild on the deployed system (e.g. change fstab UUIDs)
|
|
|
|
refer to flake.nix for more details
|
2022-05-26 20:21:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
# admin tips
|
|
|
|
|
|
|
|
online: <https://nixos.wiki/wiki/Cheatsheet>
|
|
|
|
|
|
|
|
verify ALL nix store contents with:
|
|
|
|
```sh
|
|
|
|
sudo nix-store --verify --check-contents # add the --repair flag to auto-repair as well
|
|
|
|
```
|
|
|
|
|
|
|
|
search for a package with:
|
|
|
|
```sh
|
|
|
|
nix search nixpkgs <query string>
|
|
|
|
```
|
|
|
|
|
|
|
|
find which package owns some file with:
|
|
|
|
```sh
|
|
|
|
nix-locate /bin/vim # or any other package-relative path
|
|
|
|
```
|