nix-files/readme.md
colin 43fa7fdd9f rename machines -> hosts
- shorter.
- congruent with `nixos-rebuild .` choosing what to build based on `hostname`.
- more widely used within other nix repos i've seen.
- more accurate in the case that i migrate a host to a different
machine (which i plan to do with servo).
2022-11-22 02:33:47 +00:00

54 lines
1.1 KiB
Markdown

to deploy:
```sh
nixos-rebuild --flake "./#servo" {build,switch}
```
if the target is the same as the host, nix will grab the hostname automatically:
```sh
nixos-rebuild --flake . {build,switch}
```
more options (like building packages defined in this repo):
```sh
nix flake show
```
## secrets
i use [sops](https://github.com/Mic92/sops-nix) for secrets.
see `modules/universal/secrets.nix` for some tips.
## building images
to build a distributable image (GPT-formatted image with rootfs and /boot partition):
```sh
nix build ./#imgs.lappy
```
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 (deploying ssh keys, optionally changing fs UUIDs, etc).
refer to flake.nix for more details.
## building packages
to build one of the custom sane packages, just name it:
```sh
nix build ./#fluffychat-moby
```
to build a nixpkg:
```sh
nix build ./#nixpkgs.curl
```
to build a package for another platform:
```sh
nix build ./#packages.aarch64-linux.nixpkgs.ubootRaspberryPi4_64bit
```