liminix/pkgs/mips-vm/default.nix

19 lines
457 B
Nix

{
qemu
, socat
, writeShellScriptBin
, symlinkJoin
, lib
}: let
mips-vm = writeShellScriptBin "mips-vm" ''
export PATH="${lib.makeBinPath [qemu]}:$PATH"
${builtins.readFile ./mips-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 {
name = "mips-vm";
paths = [ mips-vm connect ];
}