|
1 | 1 | # feltnerm nix-config |
2 | 2 |
|
| 3 | +[](https://github.com/feltnerm/nix-config/actions/workflows/build-vms-main.yml) |
| 4 | + |
3 | 5 | Personal NixOS, nix-darwin, and Home Manager setup using flake-parts and a small `feltnerm` module to define hosts and users. |
4 | 6 |
|
5 | 7 | ## Quick Start |
@@ -45,9 +47,33 @@ nix build .#<pkg> && ./result/bin/<pkg> |
45 | 47 |
|
46 | 48 | ## Extras |
47 | 49 |
|
48 | | -- VM images: `nixosConfigurations.<host>.config.formats.<format>` |
49 | | -- Topology diagrams: build outputs under `flake.topology` |
50 | | -- TODO Secrets: use ragenix/agenix (`age.secrets.*`, store files outside git) |
| 50 | +### VM Development |
| 51 | +- Devshell: `nix develop .#vm` |
| 52 | +- Build: `build-vm <host> <output>` |
| 53 | + - Examples: `build-vm virtmark vmWithBootLoader`, `build-vm virtmark-gui qcow`, `build-vm codemonkey iso` |
| 54 | +- Run: `run-vm ./result --memory 4096 --cpus 2` |
| 55 | +- Seed SSH keys: `seed-cloud-init mark ~/.ssh/id_ed25519.pub seed.iso` |
| 56 | + |
| 57 | +Notes |
| 58 | +- Artifacts appear at `./result` (symlink) |
| 59 | +- SSH forwarding: `ssh -p 2222 mark@localhost` |
| 60 | +- Acceleration: macOS (HVF) and Linux (KVM) auto-enabled when available |
| 61 | +- Default user: `mark` (see `configs/nixos/*/user/mark.nix`) |
| 62 | + |
| 63 | +Direct Nix builds (reference) |
| 64 | +- `nix build .#nixosConfigurations.<host>.config.system.build.vmWithBootLoader` |
| 65 | +- `nix build .#nixosConfigurations.<host>.config.system.build.vm` |
| 66 | +- `nix build .#nixosConfigurations.<host>.config.formats.{iso,qcow}` |
| 67 | + |
| 68 | +Cloud-init (optional) |
| 69 | +- Quick helper: `scripts/cloud-init-seed.sh mark ~/.ssh/id_ed25519.pub seed.iso` |
| 70 | +- Manual: |
| 71 | + - Create `user-data` and `meta-data`, then `cloud-localds seed.iso user-data meta-data` |
| 72 | + - Boot with VM image + `seed.iso`, then `ssh -p 2222 mark@localhost` |
| 73 | + |
| 74 | +Other |
| 75 | +- Topology: `flake.topology` outputs |
| 76 | +- Secrets: ragenix/agenix (`age.secrets.*`, store files outside git) |
51 | 77 |
|
52 | 78 | ## Inspiration |
53 | 79 |
|
|
0 commit comments