diff options
Diffstat (limited to 'pkgs/by-name/x1/x16/run.nix')
-rw-r--r-- | pkgs/by-name/x1/x16/run.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/by-name/x1/x16/run.nix b/pkgs/by-name/x1/x16/run.nix new file mode 100644 index 0000000000000..274e98afecca5 --- /dev/null +++ b/pkgs/by-name/x1/x16/run.nix @@ -0,0 +1,38 @@ +{ 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 |