anchor.diff:      license = licenses.unfree;
       maintainers = with maintainers; [ bbigras ];
     };
  +
  +  passthru.updateScript = writeScript "starsector-update-script" ''
  +    #!/usr/bin/env nix-shell
  +    #!nix-shell -i bash -p curl gnugrep common-updater-scripts
  +    set -eou pipefail;
  +    version=$(curl -s https://fractalsoftworks.com/preorder/ | grep -oP "https://s3.amazonaws.com/fractalsoftworks/starsector/starsector_linux-\K.*?(?=\.zip)" | head -1)
  +    update-source-version ${pname} "$version" --file=./pkgs/games/starsector/default.nix
  +  '';
   }
  
positive.code: 
    # it tries to run everything with relative paths, which makes it CWD dependent
    # also point mod, screenshot, and save directory to $XDG_DATA_HOME
    postPatch = ''
      substituteInPlace starsector.sh \
        --replace "./jre_linux/bin/java" "${openjdk}/bin/java" \
        --replace "./native/linux" "$out/native/linux"
    '';
  
    meta = with lib; {
  
negative.code: { lib
  , fetchzip
  , libXxf86vm
  , makeWrapper
  , openal
  , openjdk
  , stdenv
  , xorg
  , copyDesktopItems
  , makeDesktopItem
  , writeScript
  }:
  
  stdenv.mkDerivation rec {
    pname = "starsector";
    version = "0.95.1a-RC6";
  
    src = fetchzip {
      url = "https://s3.amazonaws.com/fractalsoftworks/starsector/starsector_linux-${version}.zip";
      sha256 = "sha256-+0zGJHM+SMonx3sytCQNQA/QBgzdPMEfQvOjrCDSOs8=";
    };
  
    nativeBuildInputs = [ copyDesktopItems makeWrapper ];
    buildInputs = [ xorg.libXxf86vm openal ];
  
    dontBuild = true;
  
  