2023-02-08 22:16:39 +00:00
|
|
|
{
|
2024-06-30 15:58:29 +00:00
|
|
|
qemuLim,
|
|
|
|
socat,
|
|
|
|
writeShellScript,
|
|
|
|
writeFennel,
|
|
|
|
runCommand,
|
2024-09-06 23:58:11 +00:00
|
|
|
fennel,
|
2024-06-30 15:58:29 +00:00
|
|
|
lib,
|
|
|
|
lua,
|
|
|
|
pkgsBuildBuild,
|
|
|
|
}:
|
|
|
|
let
|
2024-09-06 23:58:11 +00:00
|
|
|
writeFennel = pkgsBuildBuild.writeFennel.override { inherit lua; };
|
|
|
|
run-liminix-vm = writeFennel "run-liminix-vm" {
|
2025-02-10 21:55:08 +00:00
|
|
|
packages = [
|
|
|
|
qemuLim
|
|
|
|
lua.pkgs.luaposix
|
|
|
|
fennel
|
|
|
|
];
|
2023-12-03 22:51:39 +00:00
|
|
|
} ./run-liminix-vm.fnl;
|
|
|
|
connect = writeShellScript "connect-vm" ''
|
2024-06-30 15:58:29 +00:00
|
|
|
export PATH="${lib.makeBinPath [ socat ]}:$PATH"
|
2023-02-08 22:49:10 +00:00
|
|
|
socat -,raw,echo=0,icanon=0,isig=0,icrnl=0,escape=0x0f unix-connect:$1
|
|
|
|
'';
|
2025-02-10 21:55:08 +00:00
|
|
|
in
|
|
|
|
runCommand "vm" { } ''
|
2023-12-03 22:51:39 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cd $out/bin
|
|
|
|
ln -s ${connect} ./connect-vm
|
|
|
|
ln -s ${run-liminix-vm} ./run-liminix-vm
|
|
|
|
''
|