liminix/pkgs/run-liminix-vm/default.nix

20 lines
492 B
Nix
Raw Normal View History

{
qemu
, socat
, writeShellScriptBin
, symlinkJoin
, lib
}: let
2023-09-20 17:33:08 +00:00
run-liminix-vm = writeShellScriptBin "run-liminix-vm" ''
export PATH="${lib.makeBinPath [qemu]}:$PATH"
2023-09-20 17:33:08 +00:00
${builtins.readFile ./run-liminix-vm.sh}
'';
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 17:33:08 +00:00
name = "run-liminix-vm";
paths = [ run-liminix-vm connect ];
}