nix-files/readme.md

54 lines
1.1 KiB
Markdown
Raw Normal View History

2022-06-26 10:44:03 +00:00
to deploy:
```sh
2022-06-26 10:44:03 +00:00
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}
```
2022-06-26 10:44:03 +00:00
more options (like building packages defined in this repo):
```sh
nix flake show
```
2022-08-25 02:46:10 +00:00
## secrets
2022-05-27 08:01:06 +00:00
2022-06-26 10:44:03 +00:00
i use [sops](https://github.com/Mic92/sops-nix) for secrets.
see `modules/universal/secrets.nix` for some tips.
## building images
2022-05-22 10:14:50 +00:00
to build a distributable image (GPT-formatted image with rootfs and /boot partition):
```sh
2022-06-12 22:11:41 +00:00
nix build ./#imgs.lappy
```
2022-05-22 10:14:50 +00:00
this can then be `dd`'d onto a disk and directly booted from a EFI system.
2022-06-26 10:44:03 +00:00
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.
2022-05-26 20:21:40 +00:00
## 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
```