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
|
2023-09-20 19:33:08 +02:00
|
|
|
run-liminix-vm = writeShellScriptBin "run-liminix-vm" ''
|
2023-02-08 23:16:39 +01:00
|
|
|
export PATH="${lib.makeBinPath [qemu]}:$PATH"
|
2023-09-20 19:33:08 +02:00
|
|
|
${builtins.readFile ./run-liminix-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 {
|
2023-09-20 19:33:08 +02:00
|
|
|
name = "run-liminix-vm";
|
|
|
|
paths = [ run-liminix-vm connect ];
|
2023-02-08 23:49:10 +01:00
|
|
|
}
|