[PATCH 10/22] vm/app/mg.nix: open virtio filesystem in dired

Alyssa Ross
2022-10-10T23:33:00Z

vm/app/mg.nix | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/vm/app/mg.nix b/vm/app/mg.nix
index 391b518..fdfef8f 100644
--- a/vm/app/mg.nix
+++ b/vm/app/mg.nix
@@ -6,5 +6,12 @@
import ../make-vm.nix { inherit config; } {
providers.net = [ "netvm" ];
sharedDirs.virtiofs0.path = "/ext";
- run = "${config.pkgs.pkgsStatic.mg}/bin/mg";
+ run = config.pkgs.pkgsStatic.callPackage (
+ { writeScript, mg }:
+ writeScript "run-mg" ''
+ #!/bin/execlineb -P
+ if { /etc/mdev/wait virtiofs0 }
+ ${mg}/bin/mg /run/virtiofs/virtiofs0
+ ''
+ ) { };
}
--
2.37.1