2023-02-08 23:16:39 +01:00
|
|
|
{
|
2024-01-03 18:53:30 +01:00
|
|
|
qemuLim
|
2023-02-08 23:49:10 +01:00
|
|
|
, socat
|
2023-12-03 23:51:39 +01:00
|
|
|
, writeShellScript
|
|
|
|
, runCommand
|
2024-09-07 21:52:30 +02:00
|
|
|
, fennel
|
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
|
2024-09-07 21:52:30 +02:00
|
|
|
writeFennel = pkgsBuildBuild.writeFennel.override { inherit lua; };
|
|
|
|
run-liminix-vm = writeFennel "run-liminix-vm" {
|
|
|
|
packages = [ qemuLim lua.pkgs.luaposix fennel ];
|
2023-12-03 23:51:39 +01:00
|
|
|
} ./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
|
|
|
|
''
|