841d9c7fc1
GitOrigin-RevId: 3a8d7958a610cd3fec3a6f424480f91a1b259185
39 lines
688 B
Nix
39 lines
688 B
Nix
{ lib
|
|
, stdenv
|
|
, runtimeShell
|
|
, symlinkJoin
|
|
, writeTextFile
|
|
}:
|
|
|
|
{ emulator, rom }:
|
|
|
|
assert emulator.version == rom.version;
|
|
|
|
let
|
|
runScript = writeTextFile {
|
|
name = "run-x16";
|
|
text = ''
|
|
#!${runtimeShell}
|
|
|
|
defaultRom="${rom}/share/x16-rom/rom.bin"
|
|
|
|
exec "${emulator}/bin/x16emu" -rom $defaultRom "$@"
|
|
'';
|
|
executable = true;
|
|
destination = "/bin/run-x16";
|
|
};
|
|
in
|
|
symlinkJoin {
|
|
name = "run-x16-${emulator.version}";
|
|
|
|
paths = [
|
|
emulator
|
|
rom
|
|
runScript
|
|
];
|
|
}
|
|
# TODO [ AndersonTorres ]:
|
|
|
|
# 1. Parse the command line in order to allow the user to set an optional
|
|
# rom-file
|
|
# 2. generate runScript based on symlinkJoin (maybe a postBuild?)
|