From 32fa0d93b36948ebc0fe34be4ea0f0015f581385 Mon Sep 17 00:00:00 2001 From: Michael Raitza Date: Thu, 9 Jun 2022 18:00:44 +0200 Subject: [PATCH] x plane: Add ortho4XP scenery update script to x-plane-env --- x-plane/default.nix | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/x-plane/default.nix b/x-plane/default.nix index fc5dd42..5366f9d 100644 --- a/x-plane/default.nix +++ b/x-plane/default.nix @@ -35,10 +35,15 @@ let Installer run Installer SHELL run bash inside FHS environment prepare prepare all currently activated addons - revert [ADDON]... remove modifications from named addons - navdata FILE [OLDCYCLE] update navigation DB - /abs/path [ARG]... run /abs/path inside FHS environment - rel/path [ARG]... run $XPLANEPATH/rel/path inside FHS environment + revert [ADDON]... + remove modifications from named addons + navdata FILE [OLDCYCLE] + update navigation DB + ortho update links to zOrtho4XP scenery files + /abs/path [ARG]... + run /abs/path inside FHS environment + rel/path [ARG]... + run $XPLANEPATH/rel/path inside FHS environment EOF } sys=${stdenv.targetPlatform.system} @@ -57,6 +62,7 @@ let prepare) exec ${prepareScript} ;; revert) shift; exec ${revertScript} "$@" ;; navdata) shift; exec ${navdbScript} "$@" ;; + ortho) exec ${orthoScript} ;; /*) exec "$@" ;; *) shift; exec "''${XPLANEPATH}/$bin" "$@" ;; esac @@ -166,6 +172,17 @@ let ln -sf "$newpath" "$XPLANEPATH/Custom Data" ''; + orthoScript = writeScript "update-scenery-packs-ini" '' + : ''${XPLANEPATH:=${xplanePathStr}} + ( + cd "$XPLANEPATH" + sed -i -e '/^SCENERY_PACK Custom Scenery\/zOrtho4XP_.*$/d' "Custom Scenery/scenery_packs.ini" + for f in "Custom Scenery/zOrtho4XP_"*; do + echo "SCENERY_PACK $f" + done >>"Custom Scenery/scenery_packs.ini" + ) + ''; + in buildFHSUserEnv rec { name = "x-plane-env"; passthru = { inherit addons; };