spacefrogg-overlay/x-plane/better-lights.nix

32 lines
1.0 KiB
Nix
Raw Normal View History

2020-10-18 14:34:40 +02:00
{ stdenv, mkXPlaneAddon }:
mkXPlaneAddon {
pname = "better-lights";
version = "2";
fname = "lights.txt";
sha256 = "1fh5b2rwsws1095nikq7nfs49slq2rw3wwg6w5ncgq2pf083jvm5";
forumlink = "https://forums.x-plane.org/index.php?/files/file/36455-better-lights-x-plane-11-v2/";
buildCommand = ''
mkdir -p $out
cp $src $out/lights.txt
'';
passthru = {
build = ''
ln -s $ADDONPATH $out/xplane-extra/better-lights
'';
prepare = ''
mv "$XPLANEPATH/Resources/bitmaps/world/lites/lights.txt" "$XPLANEPATH/Resources/bitmaps/world/lites/lights.txt.orig"
ln -s /xplane-extra/better-lights/lights.txt "$XPLANEPATH/Resources/bitmaps/world/lites/lights.txt"
'';
revert = ''
if [ -L "$XPLANEPATH/Resources/bitmaps/world/lites/lights.txt" ]; then
rm "$XPLANEPATH/Resources/bitmaps/world/lites/lights.txt"
mv "$XPLANEPATH/Resources/bitmaps/world/lites/lights.txt.orig" "$XPLANEPATH/Resources/bitmaps/world/lites/lights.txt"
else
false
fi
'';
};
}