2023-10-03 22:17:01 +03:00
# ivabus NixOS Configuration files.
2023-07-16 16:43:13 +03:00
2023-07-30 12:29:22 +03:00
## Deploying
2023-07-30 17:51:12 +03:00
Setup disks, mount root to `/mnt` and `/boot` to `/mnt/boot` and run something like this
2023-07-30 12:44:50 +03:00
2023-09-06 11:27:11 +03:00
```
2023-07-30 12:44:50 +03:00
git clone https://github.com/ivabus/nixos /mnt/etc/nixos
2023-10-03 22:20:57 +03:00
nixos-generate-config --show-hardware-config --root /mnt > /mnt/etc/nixos/machines/HOST/hardware.nix
nixos-install --flake path:.#HOST
2023-07-30 12:29:22 +03:00
```
2023-08-31 18:51:25 +03:00
### Raspberry Pi image generation
Replace `{{REPO_PATH}}` with path to this repo (surprising, isn't it) and run on NixOS system (or system with Nix (don't tested))
2023-09-06 11:27:11 +03:00
```
2023-09-01 15:20:35 +03:00
nix build path:{{REPO_PATH}}#nixosConfigurations.HOST.config.system.build.sdImage
2023-08-31 18:51:25 +03:00
```
2023-07-30 12:29:22 +03:00
## Rebuilding
```shell
nixos-rebuild switch --flake path:/etc/nixos
```
2023-10-03 17:15:14 +03:00
Apple Silicon hosts require additional `--impure` flag for firmware installation. (Firmware should be placed in `/etc/nixos/asahi/firmware` (ignored by git)).
2023-07-30 12:29:22 +03:00
### Hosts configured
2023-10-03 17:15:14 +03:00
- celerrime (MacBook Air M2) (coding)
- vetus (iMac 27" 2017) (gaming)
2023-10-03 22:20:57 +03:00
- stella (Random Ryzen 3 3250U laptop) (lite web surfing client)
2023-10-03 17:15:14 +03:00
- rubusidaeus (Raspberry Pi 4B) (small services)
- periculo (StarFive VisionFive2) (as router) - WIP + untested
2023-09-08 21:07:54 +03:00
2023-08-24 11:06:09 +03:00
## Modules
Module example:
2023-10-03 22:20:57 +03:00
2023-08-24 11:06:09 +03:00
```nix
{ config, lib, ... }:
let
2023-09-06 11:27:11 +03:00
cfg = config.my.MODULE;
2023-08-24 11:06:09 +03:00
in {
options.my.MODULE.enable = lib.mkEnableOption "Enable MODULE";
config = lib.mkIf (cfg.enable) {
MODULE_CONFIGURATION
};
}
```
2023-08-13 17:59:59 +03:00
## Shells
I "made" some shell in [shells/ ](./shells ).
2023-07-30 15:21:12 +03:00
## Dotfiles (from `ivabus/dotfiles`)
2023-07-16 16:43:13 +03:00
2023-08-13 17:59:59 +03:00
I install my dotfiles with prepared script
2023-07-30 15:21:12 +03:00
2023-09-06 11:27:11 +03:00
```
2023-07-30 15:21:12 +03:00
curl https://iva.bz/nix | sh
```
2023-08-24 11:06:09 +03:00
## TODO
- Setup services (which I host)
2023-09-06 11:20:33 +03:00
- [x] ivabus.dev
2023-12-20 20:17:29 +03:00
- [x] iva.bz (native Nix, yay!)
2023-10-27 12:29:45 +03:00
- [x] ивабус.рф (proxying not-Nix env)
2023-08-24 11:06:09 +03:00
- Setup "secret" roles (I need them)
2023-11-25 18:13:44 +03:00
- Setup router (in progress with `periculo` , aughhhhhhhhh it seems like I need to crosscompile it for 30 days straight, so no fast progress)
2023-10-27 12:29:45 +03:00
- Setup dotfiles properly with home-manager
2023-08-30 11:26:05 +03:00
2023-08-27 18:24:51 +03:00
## Copyright
This configuration is [MIT licensed ](./LICENSE ).
I used [delroth/infra.delroth.net ](https://github.com/delroth/infra.delroth.net ) (MIT license) as a reference for my configuration.
2023-08-30 11:26:05 +03:00