summary refs log tree commit diff
path: root/release.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-07-02 00:23:48 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-07-02 11:04:31 +0200
commit1a2e4f37d0baa000f1a25bbb20036371ac0f0179 (patch)
tree3d5887465ee95f3399dace9825be1e15fc21077d /release.nix
parentdb17b68d8118e9b5d5d61ca807c36118d6b052d6 (diff)
downloadnixpkgs-1a2e4f37d0baa000f1a25bbb20036371ac0f0179.tar
nixpkgs-1a2e4f37d0baa000f1a25bbb20036371ac0f0179.tar.gz
nixpkgs-1a2e4f37d0baa000f1a25bbb20036371ac0f0179.tar.bz2
nixpkgs-1a2e4f37d0baa000f1a25bbb20036371ac0f0179.tar.lz
nixpkgs-1a2e4f37d0baa000f1a25bbb20036371ac0f0179.tar.xz
nixpkgs-1a2e4f37d0baa000f1a25bbb20036371ac0f0179.tar.zst
nixpkgs-1a2e4f37d0baa000f1a25bbb20036371ac0f0179.zip
release.nix: Generate a VirtualBox image
Diffstat (limited to 'release.nix')
-rw-r--r--release.nix38
1 files changed, 35 insertions, 3 deletions
diff --git a/release.nix b/release.nix
index 1ae786e58fb..cda5d4e6152 100644
--- a/release.nix
+++ b/release.nix
@@ -43,7 +43,7 @@ let
           passthru = { inherit config; };
         }
         ''
-          ensureDir $out/nix-support
+          mkdir -p $out/nix-support
           echo "file iso" $iso/iso/*.iso* >> $out/nix-support/hydra-build-products
         ''; # */
 
@@ -86,7 +86,7 @@ in {
       distPhase = ''
         echo -n $VERSION_SUFFIX > .version-suffix
         releaseName=nixos-$VERSION$VERSION_SUFFIX
-        ensureDir "$out/tarballs"
+        mkdir -p $out/tarballs
         mkdir ../$releaseName
         cp -prd . ../$releaseName
         cd ..
@@ -112,7 +112,7 @@ in {
       distPhase = ''
         echo -n $VERSION_SUFFIX > .version-suffix
         releaseName=nixos-$VERSION$VERSION_SUFFIX
-        ensureDir "$out/tarballs"
+        mkdir -p $out/tarballs
         mkdir ../$releaseName
         cp -prd . ../$releaseName/nixos
         cp -prd ${nixpkgs} ../$releaseName/nixpkgs
@@ -175,6 +175,38 @@ in {
   });
 
 
+  # A bootable VirtualBox image.  FIXME: generate a OVF appliance?
+  vdi.x86_64-linux =
+    with import <nixpkgs> { system = "x86_64-linux"; };
+
+    let
+
+      config = (import lib/eval-config.nix {
+        inherit system;
+        modules =
+          [ ./modules/virtualisation/virtualbox-image.nix
+            ./modules/installer/cd-dvd/channel.nix
+            ./modules/profiles/graphical.nix
+          ];
+      }).config;
+
+    in
+      # Declare the VDI as a build product so that it shows up in Hydra.
+      runCommand "nixos-vdi-${config.system.nixosVersion}"
+        { meta = {
+            description = "NixOS VirtualBox disk image (64-bit)";
+            maintainers = lib.maintainers.eelco;
+          };
+          vdi = config.system.build.virtualBoxImage;
+        }
+        ''
+          mkdir -p $out/nix-support
+          fn=$out/nixos-${config.system.nixosVersion}.vdi.xz
+          xz < $vdi/*.vdi > $fn
+          echo "file vdi $fn" >> $out/nix-support/hydra-build-products
+        ''; # */
+
+
   # Provide a tarball that can be unpacked into an SD card, and easily
   # boot that system from uboot (like for the sheevaplug).
   # The pc variant helps preparing the expression for the system tarball