2023-02-08 23:16:39 +01:00
|
|
|
{
|
|
|
|
qemu
|
2023-02-08 23:49:10 +01:00
|
|
|
, socat
|
2023-02-08 23:16:39 +01:00
|
|
|
, writeShellScriptBin
|
2023-02-08 23:49:10 +01:00
|
|
|
, symlinkJoin
|
2023-02-08 23:16:39 +01:00
|
|
|
, lib
|
2023-02-08 23:49:10 +01:00
|
|
|
}: let
|
|
|
|
mips-vm = writeShellScriptBin "mips-vm" ''
|
2023-02-08 23:16:39 +01:00
|
|
|
export PATH="${lib.makeBinPath [qemu]}:$PATH"
|
|
|
|
${builtins.readFile ./mips-vm.sh}
|
2023-02-08 23:49:10 +01:00
|
|
|
'';
|
|
|
|
connect = writeShellScriptBin "connect-vm" ''
|
|
|
|
export PATH="${lib.makeBinPath [socat]}:$PATH"
|
|
|
|
socat -,raw,echo=0,icanon=0,isig=0,icrnl=0,escape=0x0f unix-connect:$1
|
|
|
|
'';
|
|
|
|
in symlinkJoin {
|
|
|
|
name = "mips-vm";
|
|
|
|
paths = [ mips-vm connect ];
|
|
|
|
}
|