mirror of
https://codeberg.org/privacy1st/nix-git
synced 2025-01-09 04:51:20 +01:00
feat: test config in a vm
This commit is contained in:
parent
3de51a4f89
commit
27b26d8dcc
15
README.md
15
README.md
@ -19,6 +19,7 @@ See also:
|
|||||||
* [Default configuration](#default-configuration)
|
* [Default configuration](#default-configuration)
|
||||||
* [Apply modified configuration](#apply-modified-configuration)
|
* [Apply modified configuration](#apply-modified-configuration)
|
||||||
* [ARM: Vanilla UEFI bootloader for the Raspberry Pi 3B+](#arm-vanilla-uefi-bootloader-for-the-raspberry-pi-3b)
|
* [ARM: Vanilla UEFI bootloader for the Raspberry Pi 3B+](#arm-vanilla-uefi-bootloader-for-the-raspberry-pi-3b)
|
||||||
|
* [Test config changes in a VM](#test-config-changes-in-a-vm)
|
||||||
* [Update, build and switch](#update-build-and-switch)
|
* [Update, build and switch](#update-build-and-switch)
|
||||||
* [tldr](#tldr)
|
* [tldr](#tldr)
|
||||||
* [Update](#update)
|
* [Update](#update)
|
||||||
@ -158,6 +159,20 @@ Then install NixOS the way you prefer, but don't touch/modify the partition tabl
|
|||||||
|
|
||||||
See https://nixos.wiki/wiki/NixOS_on_ARM/UEFI#Installing
|
See https://nixos.wiki/wiki/NixOS_on_ARM/UEFI#Installing
|
||||||
|
|
||||||
|
## Test config changes in a VM
|
||||||
|
|
||||||
|
https://nix.dev/tutorials/nixos/nixos-configuration-on-vm.html
|
||||||
|
|
||||||
|
- See `base.nix` -> `virtualisation.vmVariant` for build-vm specific options
|
||||||
|
- Import of `./hardware-configuration.nix`
|
||||||
|
- As build-vm uses `mkVMOverride` we can just leave the import
|
||||||
|
- If in doubt, remove/uncomment it
|
||||||
|
|
||||||
|
```shell
|
||||||
|
nix-build '<nixpkgs/nixos>' -A vm -I nixos-config=./hosts/yodaTux/configuration.nix
|
||||||
|
./result/bin/run-yodaTux-vm && rm yodaTux.qcow2
|
||||||
|
```
|
||||||
|
|
||||||
## Update, build and switch
|
## Update, build and switch
|
||||||
|
|
||||||
### tldr
|
### tldr
|
||||||
|
@ -88,4 +88,15 @@
|
|||||||
# https://nixos.wiki/wiki/Firewall
|
# https://nixos.wiki/wiki/Firewall
|
||||||
# Note: Firewall rules may be bypassed/overwritten by Docker, as per https://github.com/NixOS/nixpkgs/issues/111852
|
# Note: Firewall rules may be bypassed/overwritten by Docker, as per https://github.com/NixOS/nixpkgs/issues/111852
|
||||||
networking.firewall.enable = true;
|
networking.firewall.enable = true;
|
||||||
|
|
||||||
|
# Options only for build.system.vm - they won’t get applied when building build.system.toplevel aka the normal system config.
|
||||||
|
# https://discourse.nixos.org/t/wayland-compositors-an-build-vm-not-working/46486/2
|
||||||
|
virtualisation.vmVariant = {
|
||||||
|
users.users.yoda.initialPassword = "asdf";
|
||||||
|
virtualisation.qemu.options = [
|
||||||
|
"-device virtio-vga-gl"
|
||||||
|
"-display sdl,gl=on,show-cursor=off"
|
||||||
|
"-m 8G"
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user