Skip to content

Commit da5d521

Browse files
authored
Merge pull request #45 from Mic92/memory-size
fix memorySize option
2 parents 814a69c + 21eda94 commit da5d521

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ set - otherwise you will need to start VM as root. On NixOS this can be achieved
8383

8484
## RAM
8585

86-
By default qemu will allow at most 500MB of RAM, this can be increased using `virtualisation.memorySize`.
86+
By default qemu will allow at most 500MB of RAM, this can be increased using `virtualisation.memorySize` (size in megabyte).
8787

8888
```nix
89-
{ virtualisation.memorySize = "1024M"; }
89+
{ virtualisation.memorySize = 1024; }
9090
```
9191

9292
## CPUs

examples/vm-resources.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
virtualisation = {
33
cores = 2;
4-
memorySize = "1024M";
4+
memorySize = 1024;
55
};
66
}

share/nixos-shell/nixos-shell.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ in {
117117

118118
virtualisation = {
119119
graphics = mkVMDefault false;
120-
memorySize = mkVMDefault "700M";
120+
memorySize = mkVMDefault 700;
121121

122122
qemu.consoles = lib.mkIf (!config.virtualisation.graphics) ["tty0" "hvc0"];
123123

124124
qemu.options = let
125125
nixProfile = "/nix/var/nix/profiles/per-user/${user}/profile/";
126126
in
127-
lib.optional (!config.virtualisation.graphics) [
127+
lib.optionals (!config.virtualisation.graphics) [
128128
"-serial null"
129129
"-device virtio-serial"
130130
"-chardev stdio,mux=on,id=char0,signal=off"

0 commit comments

Comments
 (0)