nixpkgs/pkgs/by-name/x1/x16/run.nix
Anderson Torres 5f0c17edea x16: move from commanderx16
Now they live under x16 attribute.
Since the old names are easier to use and remember, they should be kept as
non-removable aliases.
2023-12-10 22:24:00 -03:00

38 lines
716 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?)
# 3. a NixOS module to abstract the runner