From 4dca023385034839873b330cb6fcaf46807e0a59 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 24 Jul 2020 21:03:42 -0400 Subject: feat(3p/nix): Add build for VM for testing tvix Add an expression, based on the nixos qemu virtualisation framework, for a basic system whose nix is tvix, to be used for testing tvix Change-Id: I3c7422bb10d3ce05a3094671cb770f1f745d814c Reviewed-on: https://cl.tvl.fyi/c/depot/+/1423 Reviewed-by: tazjin Reviewed-by: Alyssa Ross Tested-by: BuildkiteCI --- ci-builds.nix | 1 + third_party/nix/default.nix | 6 +++++- third_party/nix/test-vm.nix | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 third_party/nix/test-vm.nix diff --git a/ci-builds.nix b/ci-builds.nix index 921b6f335f..d4ea63d99e 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 bc25689461..c8ed5adc87 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 0000000000..534a3fc930 --- /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 -- cgit 1.4.1