Unverified Commit d1a0237f authored by Jasi's avatar Jasi
Browse files

muvm: simplify wrapper code

parent 4067b99a
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -24,24 +24,26 @@ let
      coreutils
    ];
    text = ''
      if [[ ! -f /etc/NIXOS ]]; then exit; fi

      if [[ -f /etc/NIXOS ]]; then
        ln -s /run/muvm-host/run/current-system /run/current-system
      # Only create the symlink if that path exists on the host and is a directory.
      if [[ -d /run/muvm-host/run/opengl-driver ]]; then ln -s /run/muvm-host/run/opengl-driver /run/opengl-driver; fi
        if [[ -d /run/muvm-host/run/opengl-driver ]]; then
           ln -s /run/muvm-host/run/opengl-driver /run/opengl-driver
        fi
      fi
    '';
  };
  binPath = [
    dhcpcd
    passt
    (placeholder "out")
  ]
  ++ lib.optionals stdenv.hostPlatform.isAarch64 [ fex ];
  wrapArgs = lib.escapeShellArgs [
    "--prefix"
    "PATH"
    ":"
    (lib.makeBinPath binPath)
    (lib.makeBinPath (
      [
        dhcpcd
        passt
        (placeholder "out")
      ]
      ++ lib.optionals stdenv.hostPlatform.isAarch64 [ fex ]
    ))
    "--add-flags"
    "--execute-pre=${lib.getExe initScript}"
  ];