2023-02-08 23:16:39 +01:00
|
|
|
{
|
|
|
|
qemu
|
2023-02-08 23:49:10 +01:00
|
|
|
, socat
|
2023-12-03 23:51:39 +01:00
|
|
|
, writeShellScript
|
|
|
|
, writeFennel
|
|
|
|
, runCommand
|
2023-02-08 23:16:39 +01:00
|
|
|
, lib
|
2023-12-03 23:51:39 +01:00
|
|
|
, lua
|
|
|
|
, pkgsBuildBuild
|
2023-02-08 23:49:10 +01:00
|
|
|
}: let
|
2023-12-03 23:51:39 +01:00
|
|
|
run-liminix-vm = pkgsBuildBuild.writeFennel "run-liminix-vm" {
|
|
|
|
packages = [ qemu lua.pkgs.luaposix lua.pkgs.fennel ];
|
|
|
|
} ./run-liminix-vm.fnl;
|
|
|
|
connect = writeShellScript "connect-vm" ''
|
2023-02-08 23:49:10 +01:00
|
|
|
export PATH="${lib.makeBinPath [socat]}:$PATH"
|
|
|
|
socat -,raw,echo=0,icanon=0,isig=0,icrnl=0,escape=0x0f unix-connect:$1
|
|
|
|
'';
|
2023-12-03 23:51:39 +01:00
|
|
|
in runCommand "vm" {} ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cd $out/bin
|
|
|
|
ln -s ${connect} ./connect-vm
|
|
|
|
ln -s ${run-liminix-vm} ./run-liminix-vm
|
|
|
|
''
|