1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 05:31:22 +00:00
nixpkgs/pkgs/games/quake2/yquake2/wrapper.nix
2018-04-12 11:49:11 -07:00

32 lines
615 B
Nix

{ stdenv, lib, buildEnv, makeWrapper, yquake2 }:
{ games
, name
, description
}:
let
env = buildEnv {
name = "${name}-env";
paths = [ yquake2 ] ++ games;
};
in stdenv.mkDerivation {
inherit name;
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
mkdir -p $out/bin
'' + lib.concatMapStringsSep "\n" (game: ''
makeWrapper ${env}/bin/yquake2 $out/bin/yquake2-${game.title} \
--add-flags "+set game ${game.id}"
makeWrapper ${env}/bin/yq2ded $out/bin/yq2ded-${game.title} \
--add-flags "+set game ${game.id}"
'') games;
meta = {
inherit description;
};
}