From 8bf46eb0e00a8abd696ebaa9aa526f9fc3da2465 Mon Sep 17 00:00:00 2001 From: Bad Date: Thu, 7 Apr 2022 19:58:13 +0200 Subject: [PATCH] Add olympus(celeste mod tool) --- pkgs/default.nix | 1 + pkgs/olympus.nix | 43 +++++++++++++++++++++++++++++++++++++++ profiles/game/default.nix | 1 + 3 files changed, 45 insertions(+) create mode 100644 pkgs/olympus.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 5090c16..34be1dc 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -3,4 +3,5 @@ final: prev: rec { sources = prev.callPackage (import ./_sources/generated.nix) { }; # then, call packages with `final.callPackage` go-fold-if-err-nil = final.callPackage ./go-fold-if-err-nil.nix { }; + olympus = final.callPackage ./olympus.nix { }; } diff --git a/pkgs/olympus.nix b/pkgs/olympus.nix new file mode 100644 index 0000000..9a3d217 --- /dev/null +++ b/pkgs/olympus.nix @@ -0,0 +1,43 @@ +{ pkgs, makeDesktopItem }: +let + olympus = pkgs.stdenv.mkDerivation rec { + pname = "olympus"; + version = "2551"; + + # https://everestapi.github.io/ + src = pkgs.fetchzip { + url = "https://dev.azure.com/EverestAPI/Olympus/_apis/build/builds/${version}/artifacts?artifactName=linux.main&$format=zip#linux.main.zip"; + hash = "sha256-Iq/FjDwckbOKE7s3xud0OQrxxjGqL0ZR9MQIaLs54OU="; + }; + + buildInputs = [ pkgs.unzip ]; + installPhase = '' + mkdir -p "$out/opt/olympus/" + mv dist.zip "$out/opt/olympus/" && cd "$out/opt/olympus/" + + unzip dist.zip && rm dist.zip + mkdir $out && echo XDG_DATA_HOME=$out + + echo y | XDG_DATA_HOME="$out/share/" bash install.sh + sed -i "/ldconfig/d" ./love && rm ./usr/lib/libSDL2-2.0.so.0 + sed -i "s/Exec=.*/Exec=olympus %u/g" ../../share/applications/Olympus.desktop + ''; + }; +in +pkgs.buildFHSUserEnv { + name = "olympus"; + runScript = "${olympus}/opt/olympus/olympus"; + targetPkgs = pkgs: [ + pkgs.freetype + pkgs.zlib + pkgs.SDL2 + pkgs.curl + pkgs.libpulseaudio + pkgs.gtk3 + pkgs.glib + ]; + + # https://github.com/EverestAPI/Olympus/blob/main/lib-linux/olympus.desktop + # https://stackoverflow.com/questions/8822097/how-to-replace-a-whole-line-with-sed + extraInstallCommands = ''cp -r "${olympus}/share/" $out''; +} diff --git a/profiles/game/default.nix b/profiles/game/default.nix index 21181af..a2b57f2 100644 --- a/profiles/game/default.nix +++ b/profiles/game/default.nix @@ -8,6 +8,7 @@ mumble polymc (retroarch.override {cores = [libretro.snes9x]; }) + olympus godot ]; }