[PATCH 09/22] vm/app/mg.nix: init

Alyssa Ross
2022-10-10T23:32:40Z

mg is a text editor with a built-in filesystem browser, so it will be
useful for testing virtiofs.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
host/initramfs/extfs.nix | 4 +++-
vm/app/mg.nix | 10 ++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
create mode 100644 vm/app/mg.nix

diff --git a/host/initramfs/extfs.nix b/host/initramfs/extfs.nix
index dec4017..0ee337b 100644
--- a/host/initramfs/extfs.nix
+++ b/host/initramfs/extfs.nix
@@ -11,18 +11,20 @@ let

appvm-catgirl = import ../../vm/app/catgirl.nix { inherit config; };
appvm-lynx = import ../../vm/app/lynx.nix { inherit config; };
+ appvm-mg = import ../../vm/app/mg.nix { inherit config; };
in

runCommand "ext.ext4" {
nativeBuildInputs = [ tar2ext4 ];
} ''
- mkdir -p svc/data/appvm-{catgirl,lynx}
+ mkdir -p svc/data/appvm-{catgirl,lynx,mg}

tar -C ${netvm} -c data | tar -C svc -x
chmod +w svc/data

tar -C ${appvm-catgirl} -c . | tar -C svc/data/appvm-catgirl -x
tar -C ${appvm-lynx} -c . | tar -C svc/data/appvm-lynx -x
+ tar -C ${appvm-mg} -c . | tar -C svc/data/appvm-mg -x

tar -cf ext.tar svc
tar2ext4 -i ext.tar -o $out
diff --git a/vm/app/mg.nix b/vm/app/mg.nix
new file mode 100644
index 0000000..391b518
--- /dev/null
+++ b/vm/app/mg.nix
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
+
+{ config ? import ../../../nix/eval-config.nix {} }:
+
+import ../make-vm.nix { inherit config; } {
+ providers.net = [ "netvm" ];
+ sharedDirs.virtiofs0.path = "/ext";
+ run = "${config.pkgs.pkgsStatic.mg}/bin/mg";
+}
--
2.37.1