about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ci-builds.nix1
-rw-r--r--third_party/nix/default.nix6
-rw-r--r--third_party/nix/test-vm.nix17
3 files changed, 23 insertions, 1 deletions
diff --git a/ci-builds.nix b/ci-builds.nix
index 921b6f335f98..d4ea63d99ea2 100644
--- a/ci-builds.nix
+++ b/ci-builds.nix
@@ -63,6 +63,7 @@ in lib.fix (self: {
     git
     grpc
     nix
+    nix.test-vm
     openldap
     rapidcheck
   ] ++ builtins.attrValues lisp;
diff --git a/third_party/nix/default.nix b/third_party/nix/default.nix
index bc25689461d6..c8ed5adc8720 100644
--- a/third_party/nix/default.nix
+++ b/third_party/nix/default.nix
@@ -1,4 +1,6 @@
-{ pkgs ? (import ../.. {}).third_party
+args@{
+  pkgs ? (import ../.. {}).third_party
+, lib
 , buildType ? "release"
 , depotPath ? ../..
 , ...
@@ -138,4 +140,6 @@ in pkgs.llvmPackages.libcxxStdenv.mkDerivation {
 
   # TODO(tazjin): integration test setup?
   # TODO(tazjin): docs generation?
+
+  passthru = { test-vm = import ./test-vm.nix args; };
 }
diff --git a/third_party/nix/test-vm.nix b/third_party/nix/test-vm.nix
new file mode 100644
index 000000000000..534a3fc9304c
--- /dev/null
+++ b/third_party/nix/test-vm.nix
@@ -0,0 +1,17 @@
+{ depot, pkgs, ... }:
+
+let
+
+  configuration = { ... }: {
+    imports = [
+      "${pkgs.nixpkgsSrc}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
+    ];
+
+    nix.package = depot.third_party.nix;
+
+    virtualisation.qemu.options = [ "-nographic" ];
+  };
+
+  system = pkgs.nixos { inherit configuration; };
+
+in system.vm