2022-06-26 10:44:03 +00:00
|
|
|
to deploy:
|
2022-10-15 08:28:30 +00:00
|
|
|
|
2022-05-21 01:59:51 +00:00
|
|
|
```sh
|
2023-01-11 09:53:27 +00:00
|
|
|
nixos-rebuild --flake ".#servo" {build,switch}
|
2022-05-21 01:59:51 +00:00
|
|
|
```
|
|
|
|
|
2022-11-22 02:33:47 +00:00
|
|
|
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):
|
2022-10-15 08:28:30 +00:00
|
|
|
|
2022-05-21 01:59:51 +00:00
|
|
|
```sh
|
|
|
|
nix flake show
|
|
|
|
```
|
2022-05-21 02:08:49 +00:00
|
|
|
|
|
|
|
|
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.
|
2023-01-11 09:53:27 +00:00
|
|
|
see `hosts/common/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.
|
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
|
|
|
|
2022-09-23 00:44:57 +00:00
|
|
|
## building packages
|
|
|
|
|
2023-01-11 09:53:27 +00:00
|
|
|
build anything with
|
|
|
|
```
|
|
|
|
nix build .#<pkgname>
|
2022-09-23 00:44:57 +00:00
|
|
|
```
|
2022-10-15 08:28:30 +00:00
|
|
|
|
2023-01-11 09:53:27 +00:00
|
|
|
specifically, i pass the full package closure to the `legacyPackages` flake output. that includes both my own packages and upstream packages.
|
2022-10-15 08:28:30 +00:00
|
|
|
|
2023-01-11 09:53:27 +00:00
|
|
|
on the other hand the `packages` output contains only my own packages.
|
2022-10-15 08:28:30 +00:00
|
|
|
|
2023-01-11 09:53:27 +00:00
|
|
|
in addition, my packages are placed into both the global scope and a `sane` scope.
|
|
|
|
so use the scoped path when you want to be explicit.
|
2022-10-15 08:28:30 +00:00
|
|
|
|
2023-01-11 09:53:27 +00:00
|
|
|
```
|
|
|
|
nix build sane.linux-megous
|
2022-10-15 08:28:30 +00:00
|
|
|
```
|
2022-11-22 05:34:11 +00:00
|
|
|
|
|
|
|
## using this repo in your own config
|
|
|
|
|
2023-01-11 09:53:27 +00:00
|
|
|
this should be a pretty "standard" flake. just reference it, and import either
|
|
|
|
- `nixosModules.sane` (for the modules)
|
|
|
|
- `overlays.pkgs` (for the packages)
|
|
|
|
|
|
|
|
`nixosModules.sane` corresponds to everything in the `modules/` directory.
|
|
|
|
it's a mix of broad and narrow scope options.
|
|
|
|
e.g. `sane.fs` is a completely standalone thing,
|
|
|
|
whereas `sane.web-browser` is highly personalized and doesn't *really* make sense to export.
|
|
|
|
regardless of scope, i do try to ensure that everything in `modules/` is hidden behind some enable flag
|
|
|
|
so that the disorganization isn't that critical.
|
2022-11-22 05:34:11 +00:00
|
|
|
|
|
|
|
## contact
|
|
|
|
|
|
|
|
if you want to contact me for questions, or collaborate to split something useful into a shared repo, etc,
|
|
|
|
you can reach me via any method listed [here](https://uninsane.org/about).
|