1 { stdenv, lib, requireFile, writeText, fetchFromGitHub, haskellPackages }:
5 padded = (lib.optionalString (lib.lessThan num 10) "0") + toString num;
6 in "slides.spins.${padded} = 3DOVID:" +
7 "addons/3dovideo/spins/ship${padded}.duk:" +
8 "addons/3dovideo/spins/spin.aif:" +
9 "addons/3dovideo/spins/ship${padded}.aif:89";
11 videoRMP = writeText "3dovideo.rmp" (''
12 slides.ending = 3DOVID:addons/3dovideo/ending/victory.duk
13 slides.intro = 3DOVID:addons/3dovideo/intro/intro.duk
14 '' + lib.concatMapStrings makeSpin (lib.range 0 24));
16 helper = with haskellPackages; mkDerivation rec {
20 src = fetchFromGitHub {
24 hash = "sha256-rK30u2PBysiSGSA9829F1Nom/wtoVN6rGTBneRKeWEw=";
30 buildDepends = [ base binary bytestring filepath tar ];
32 description = "Extract video files from a Star Control II 3DO image";
33 license = lib.licenses.bsd3;
36 in stdenv.mkDerivation {
37 name = "uqm-3dovideo";
39 src = requireFile rec {
41 sha256 = "044h0cl69r0kc43vk4n0akk0prwzb7inq324h5yfqb38sd4zkds1";
43 In order to get the intro and ending sequences from the 3DO version, you
44 need to have the original 3DO Star Control II CD. Create an image from
45 the CD and use uqm3donix* to extract a tarball with the videos from it.
46 The reason for this is because the 3DO uses its own proprietary disk
49 Save the file as videos.tar and use "nix-prefetch-url file://\$PWD/${name}" to
50 add it to the Nix store.
52 [*] ${helper}/bin/uqm3donix CDIMAGE ${name}
58 tar xf "$src" -C "$out" --strip-components=3
59 cp "${videoRMP}" "$out/3dovideo.rmp"