Build 32-bit VirtualBox image

Issue #200.
This commit is contained in:
Eelco Dolstra 2013-08-26 14:06:00 +02:00
parent 40c6f6252e
commit 3395e4398f
2 changed files with 10 additions and 7 deletions

View File

@ -6,7 +6,7 @@ with pkgs.lib;
system.build.virtualBoxImage = system.build.virtualBoxImage =
pkgs.vmTools.runInLinuxVM ( pkgs.vmTools.runInLinuxVM (
pkgs.runCommand "virtualbox-image" pkgs.runCommand "virtualbox-image"
{ memSize = 2048; { memSize = 2047;
preVM = preVM =
'' ''
mkdir $out mkdir $out

View File

@ -175,8 +175,9 @@ in {
# A bootable VirtualBox image. FIXME: generate a OVF appliance? # A bootable VirtualBox image. FIXME: generate a OVF appliance?
vdi.x86_64-linux = vdi = pkgs.lib.genAttrs systems (system:
with import <nixpkgs> { system = "x86_64-linux"; };
with import <nixpkgs> { inherit system; };
let let
@ -190,19 +191,21 @@ in {
in in
# Declare the VDI as a build product so that it shows up in Hydra. # Declare the VDI as a build product so that it shows up in Hydra.
runCommand "nixos-vdi-${config.system.nixosVersion}" runCommand "nixos-vdi-${config.system.nixosVersion}-${system}"
{ meta = { { meta = {
description = "NixOS VirtualBox disk image (64-bit)"; description = "NixOS VirtualBox disk image (${system})";
maintainers = lib.maintainers.eelco; maintainers = lib.maintainers.eelco;
}; };
vdi = config.system.build.virtualBoxImage; vdi = config.system.build.virtualBoxImage;
} }
'' ''
mkdir -p $out/nix-support mkdir -p $out/nix-support
fn=$out/nixos-${config.system.nixosVersion}.vdi.xz fn=$out/nixos-${config.system.nixosVersion}-${system}.vdi.xz
xz < $vdi/*.vdi > $fn xz < $vdi/*.vdi > $fn
echo "file vdi $fn" >> $out/nix-support/hydra-build-products echo "file vdi $fn" >> $out/nix-support/hydra-build-products
''; # */ '' # */
);
# Provide a tarball that can be unpacked into an SD card, and easily # Provide a tarball that can be unpacked into an SD card, and easily