summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-04-21 19:18:55 +0000
committerAlyssa Ross <hi@alyssa.is>2020-04-21 19:18:55 +0000
commit50bf83f3d911b2d9f627de9087172935294244ad (patch)
treee39960c2e0f910047750dbab7d3af6d9c0272910
parent99471db2121d81a03b5300b6c59aef2e1cb32b02 (diff)
downloadnixpkgs-50bf83f3d911b2d9f627de9087172935294244ad.tar
nixpkgs-50bf83f3d911b2d9f627de9087172935294244ad.tar.gz
nixpkgs-50bf83f3d911b2d9f627de9087172935294244ad.tar.bz2
nixpkgs-50bf83f3d911b2d9f627de9087172935294244ad.tar.lz
nixpkgs-50bf83f3d911b2d9f627de9087172935294244ad.tar.xz
nixpkgs-50bf83f3d911b2d9f627de9087172935294244ad.tar.zst
nixpkgs-50bf83f3d911b2d9f627de9087172935294244ad.zip
start-vm.nix: remove remote fs VM
This will be replaced with some virtio setup anyway, and it makes
testing other things difficult because the console input and output of
both VMs is iterleaved with each other, making it very difficult to
see what's going on or interact with a VM.
-rw-r--r--start-vm.nix40
1 files changed, 7 insertions, 33 deletions
diff --git a/start-vm.nix b/start-vm.nix
index 2d8a58a6cec..7edb432720d 100644
--- a/start-vm.nix
+++ b/start-vm.nix
@@ -75,12 +75,14 @@ let
       if { s6-mount -t proc none /proc }
       if { s6-ln -s ${mesa.drivers} /run/opengl-driver }
 
-      if { ip addr add 10.0.10${toString tapFD}.2/24 dev eth0 }
-      if { ip link set eth0 up }
-      ${lib.optionalString (run != null) "if {"}
-          ip route add default via 10.0.10${toString tapFD}.1
+      ${lib.optionalString (tapFD != null) ''
+        if { ip addr add 10.0.10${toString tapFD}.2/24 dev eth0 }
+        if { ip link set eth0 up }
+        ${lib.optionalString (run != null) "if {"}
+            ip route add default via 10.0.10${toString tapFD}.1
+        ${lib.optionalString (run != null) "}"}
+      ''}
       ${lib.optionalString (run != null) ''
-        }
         export XDG_RUNTIME_DIR /run/user/0
         foreground { ${run} }
         importas -i ? ?
@@ -142,7 +144,6 @@ let
 
   fsVM = makeVM {
     name = "fs-vm";
-    tapFD = 3;
 
     services.unpfs.run = writeScript "unpfs-run" ''
       #! ${execline}/bin/execlineb -P
@@ -162,13 +163,6 @@ let
       ${busybox}/bin/getty -i -n -l ${login} 38400 ttyS0
     '';
     run = ''
-      background {
-        if { s6-mkdir /run/mnt }
-        loopwhilex
-        if -n { s6-mount -t 9p 10.0.103.2 /run/mnt }
-        s6-sleep 1
-      }
-
       if { chown user /dev/wl0 }
 
       ${s6}/bin/s6-applyuidgid -u 1000 -g 1000
@@ -178,7 +172,6 @@ let
       ${sway-unwrapped}/bin/sway -Vc ${swayConfig}
     '';
     wayland = true;
-    tapFD = 4;
   };
 
 in
@@ -189,27 +182,8 @@ writeScript "crosvm" ''
   importas -i xdg_runtime_dir XDG_RUNTIME_DIR
   importas -i wayland_display WAYLAND_DISPLAY
 
-  sudo
-
-  importas -i uid SUDO_UID
-  importas -i gid SUDO_GID
-
-  ${mktuntap}/bin/mktuntap -pvB 3
-  importas -iu tap_name_3 TUNTAP_NAME
-
-  ${mktuntap}/bin/mktuntap -pvB 4
-  importas -iu tap_name_4 TUNTAP_NAME
-
-  if { ip addr add 10.0.103.1/24 dev $tap_name_3 }
-  if { ip addr add 10.0.104.1/24 dev $tap_name_4 }
-  if { ip link set $tap_name_3 up }
-  if { ip link set $tap_name_4 up }
-
-  ${s6}/bin/s6-applyuidgid -u $uid -g $gid
-
   export XDG_RUNTIME_DIR $xdg_runtime_dir
   export WAYLAND_DISPLAY $wayland_display
 
-  background { ${fsVM} }
   ${waylandVM}
 ''