{ pkgs? import {}, xplanePathStr }: let runScript = pkgs.writeScript "x-plane-script" '' #!${pkgs.stdenv.shell} sys=${pkgs.stdenv.targetPlatform.system} sys=''${sys%-linux} : ''${XPLANEPATH:=${xplanePathStr}} case $1 in X-Plane) exec "''${XPLANEPATH}/X-Plane-$sys" ;; Airfoil*) exec "''${XPLANEPATH}/Airfoil Maker-$sys" ;; Plane*) exec "''${XPLANEPATH}/Plane Maker-$sys" ;; ''') exec "''${XPLANEPATH}/X-Plane-$sys" ;; SHELL) exec "bash" ;; *) exec "''${XPLANEPATH}/$1" ;; esac ''; in pkgs.buildFHSUserEnv rec { name = "x-plane-env"; # Also add GAppsWrapper environment stuff such that binaries see the GTK theme... targetPkgs = pkgs: (with pkgs; [ unzip atk gdk_pixbuf cairo pango mesa_glu libGL openalSoft gtk2 glib dbus pulseaudio ] ++ (with xorg; [ libX11 libXext libXrandr libXcursor libXinerama ])); extraBuildCommands = '' chmod u+w $out/etc mkdir $out/etc/openal chmod u-w $out/etc echo "drivers=pulse" > $out/etc/openal/alsoft.conf ''; inherit runScript; }