summary refs log tree commit diff
path: root/host/start-vm/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-02-02 15:19:20 +0000
committerAlyssa Ross <hi@alyssa.is>2022-02-14 14:17:19 +0000
commit12e4cd012bd6338713c870b8116dd1ea9db7a354 (patch)
tree01db6e492df1e0de0b9fb640f54dd159753671cd /host/start-vm/default.nix
parent42c9aaaf111269624e751e3140ccc9460c365b3d (diff)
downloadspectrum-12e4cd012bd6338713c870b8116dd1ea9db7a354.tar
spectrum-12e4cd012bd6338713c870b8116dd1ea9db7a354.tar.gz
spectrum-12e4cd012bd6338713c870b8116dd1ea9db7a354.tar.bz2
spectrum-12e4cd012bd6338713c870b8116dd1ea9db7a354.tar.lz
spectrum-12e4cd012bd6338713c870b8116dd1ea9db7a354.tar.xz
spectrum-12e4cd012bd6338713c870b8116dd1ea9db7a354.tar.zst
spectrum-12e4cd012bd6338713c870b8116dd1ea9db7a354.zip
host/rootfs: dynamically generate s6-rc services
This way, we don't allow arbitrary code from the ext partition to run
on the host system, which gives us better integrity guarantees when
paired with Secure Boot.  This new scheme also makes it easy to
introspect VMs, since they're defined using a very limited
configuration language.
Diffstat (limited to 'host/start-vm/default.nix')
-rw-r--r--host/start-vm/default.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/host/start-vm/default.nix b/host/start-vm/default.nix
new file mode 100644
index 0000000..8fd4933
--- /dev/null
+++ b/host/start-vm/default.nix
@@ -0,0 +1,29 @@
+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
+
+{ pkgs ? import <nixpkgs> {} }: pkgs.callPackage (
+{ pkgsBuildHost, lib, stdenv, fetchpatch, rust, ninja, rustc }:
+
+let
+  inherit (lib) cleanSource;
+
+  meson' = pkgsBuildHost.meson_0_60.overrideAttrs ({ patches ? [], ... }: {
+    patches = patches ++ [
+      (fetchpatch {
+        url = "https://github.com/alyssais/meson/commit/e8464d47fa8971098d626744b14db5d066ebf753.patch";
+        sha256 = "0naxj0s16w6ffk6d7xg1m6kkx2a7zd0hz8mbvn70xy1k12a0c5gy";
+      })
+    ];
+  });
+in
+
+stdenv.mkDerivation {
+  name = "start-vm";
+
+  src = cleanSource ./.;
+
+  nativeBuildInputs = [ meson' ninja rustc ];
+
+  dontStrip = true;
+}
+) { }