mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 18:53:17 +00:00
8d65e832f0
Emulators form a class by themselves. So, they should be moved to applications/.
38 lines
673 B
Nix
38 lines
673 B
Nix
{ 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?)
|