mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 11:44:07 +00:00
* Add an option ‘deployment.virtualbox.baseImage’ to specify the
VirtualBox/Charon base image. svn path=/nixos/trunk/; revision=32743
This commit is contained in:
parent
65824d40e1
commit
5d5fc5f675
@ -156,6 +156,17 @@ let cfg = config.deployment; in
|
||||
'';
|
||||
};
|
||||
|
||||
# VirtualBox options.
|
||||
|
||||
deployment.virtualbox.baseImage = mkOption {
|
||||
example = "/home/alice/base-disk.vdi";
|
||||
description = ''
|
||||
Path to the initial disk image used to bootstrap the
|
||||
VirtualBox instance. The instance boots from a clone of this
|
||||
image.
|
||||
'';
|
||||
};
|
||||
|
||||
# Computed options useful for referring to other machines in
|
||||
# network specifications.
|
||||
|
||||
@ -198,6 +209,25 @@ let cfg = config.deployment; in
|
||||
"");
|
||||
|
||||
};
|
||||
|
||||
deployment.virtualbox = {
|
||||
|
||||
baseImage = mkDefault (
|
||||
let
|
||||
unpack = name: sha256: pkgs.runCommand "virtualbox-charon-${name}.vdi" {}
|
||||
''
|
||||
xz < ${pkgs.fetchurl {
|
||||
url = "http://nixos.org/releases/nixos/virtualbox-charon-images/virtualbox-charon-${name}.vdi.xz";
|
||||
inherit sha256;
|
||||
}} > $out
|
||||
'';
|
||||
in if config.nixpkgs.system == "x86_64-linux" then
|
||||
unpack "r32740-x86_64" "0vwjcf85y4qyd5hxh8gb2nnkhbpdz2j284w5d7x94rvczfpa49hz"
|
||||
else if config.nixpkgs.system == "i686-linux" then /foo/disk.vdi else
|
||||
throw "Unsupported VirtualBox system type!"
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user