svn path=/nixos/branches/modular-nixos/; revision=16024
This commit is contained in:
parent
0b39f614e9
commit
64d8af9677
@ -11,11 +11,13 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
vmName = config.networking.hostName;
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
virtualisation.diskImage =
|
virtualisation.diskImage =
|
||||||
pkgs.lib.mkOption {
|
pkgs.lib.mkOption {
|
||||||
default = "./${config.networking.hostName}.qcow2";
|
default = "./${vmName}.qcow2";
|
||||||
description =
|
description =
|
||||||
''
|
''
|
||||||
Path to the disk image containing the root filesystem.
|
Path to the disk image containing the root filesystem.
|
||||||
@ -45,8 +47,7 @@ let
|
|||||||
-drive file=$NIX_DISK_IMAGE,if=virtio,boot=on \
|
-drive file=$NIX_DISK_IMAGE,if=virtio,boot=on \
|
||||||
-kernel ${config.system.build.system}/kernel \
|
-kernel ${config.system.build.system}/kernel \
|
||||||
-initrd ${config.system.build.system}/initrd \
|
-initrd ${config.system.build.system}/initrd \
|
||||||
-redir tcp:8080::80 \
|
$QEMU_OPTS \
|
||||||
-redir tcp:8022::22 \
|
|
||||||
-append "$(cat ${config.system.build.system}/kernel-params) init=${config.system.build.bootStage2} systemConfig=${config.system.build.system}"
|
-append "$(cat ${config.system.build.system}/kernel-params) init=${config.system.build.bootStage2} systemConfig=${config.system.build.system}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -107,7 +108,7 @@ in
|
|||||||
''
|
''
|
||||||
ensureDir $out/bin
|
ensureDir $out/bin
|
||||||
ln -s ${config.system.build.system} $out/system
|
ln -s ${config.system.build.system} $out/system
|
||||||
ln -s ${pkgs.writeScript "run-nixos-vm" startVM} $out/bin/run-nixos-vm
|
ln -s ${pkgs.writeScript "run-nixos-vm" startVM} $out/bin/run-${vmName}-vm
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# sendfile() is currently broken over CIFS, so fix it here for all
|
# sendfile() is currently broken over CIFS, so fix it here for all
|
||||||
|
Loading…
x
Reference in New Issue
Block a user