This commit is contained in:
parent
2abd5f2084
commit
f043d47382
2 changed files with 35 additions and 0 deletions
25
README.md
25
README.md
|
@ -10,6 +10,31 @@ nixos-rebuild switch --flake flake_path_directory#hostname
|
||||||
nix flake update --extra-experimental-features "nix-command flakes"
|
nix flake update --extra-experimental-features "nix-command flakes"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Configure VM
|
||||||
|
|
||||||
|
Configure VM
|
||||||
|
```nix
|
||||||
|
users.users.<user>.initialPassword = "<password>";
|
||||||
|
virtualisation.vmVariant = {
|
||||||
|
# following configuration is added only when building VM with build-vm
|
||||||
|
virtualisation = {
|
||||||
|
memorySize = <RAM in MiB>; # Use 8192MiB memory.
|
||||||
|
cores = <CPU Core number>;
|
||||||
|
# And more here https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/virtualisation/qemu-vm.nix
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
Build
|
||||||
|
```bash
|
||||||
|
nixos-rebuild build-vm --flake .#nixos-test
|
||||||
|
```
|
||||||
|
|
||||||
|
Run
|
||||||
|
```bash
|
||||||
|
./result/bin/run-nixos-vm-vm
|
||||||
|
```
|
||||||
|
|
||||||
## Show changements between revisions
|
## Show changements between revisions
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,5 +30,15 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Configure for testing in vm
|
||||||
|
users.users.florian.initialPassword = "test";
|
||||||
|
virtualisation.vmVariant = {
|
||||||
|
# following configuration is added only when building VM with build-vm
|
||||||
|
virtualisation = {
|
||||||
|
memorySize = 8192; # Use 8192MiB memory.
|
||||||
|
cores = 8;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
networking.hostName = "nixos-vm"; # Define your hostname.
|
networking.hostName = "nixos-vm"; # Define your hostname.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue