Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 49 lines 1.3 kB view raw
1{ 2 stdenv, 3 bubblewrap, 4 mktemp, 5 writeShellScript, 6 bitwig-studio-unwrapped, 7}: 8stdenv.mkDerivation { 9 inherit (bitwig-studio-unwrapped) version; 10 11 pname = "bitwig-studio"; 12 13 dontUnpack = true; 14 dontConfigure = true; 15 dontBuild = true; 16 dontPatchELF = true; 17 dontStrip = true; 18 19 installPhase = 20 let 21 wrapper = writeShellScript "bitwig-studio" '' 22 set -e 23 24 echo "Creating temporary directory" 25 TMPDIR=$(${mktemp}/bin/mktemp --directory) 26 echo "Temporary directory: $TMPDIR" 27 echo "Copying default Vamp Plugin settings" 28 cp -r ${bitwig-studio-unwrapped}/libexec/resources/VampTransforms $TMPDIR 29 echo "Changing permissions to be writable" 30 chmod -R u+w $TMPDIR/VampTransforms 31 32 echo "Starting Bitwig Studio in Bubblewrap Environment" 33 ${bubblewrap}/bin/bwrap \ 34 --bind / / \ 35 --bind $TMPDIR/VampTransforms ${bitwig-studio-unwrapped}/libexec/resources/VampTransforms \ 36 --dev-bind /dev /dev \ 37 ${bitwig-studio-unwrapped}/bin/bitwig-studio \ 38 || true 39 40 echo "Bitwig exited, removing temporary directory" 41 rm -rf $TMPDIR 42 ''; 43 in 44 '' 45 mkdir -p $out/bin 46 cp ${wrapper} $out/bin/bitwig-studio 47 cp -r ${bitwig-studio-unwrapped}/share $out 48 ''; 49}