Added Olympus Mod-loader Installer for Celeste
Some checks failed
/ Check Nix Flake (push) Has been cancelled

This commit is contained in:
Kaybee 2025-04-11 23:01:05 +02:00
parent 2232055e7b
commit ea9cb70b19
Signed by: kb01
SSH key fingerprint: SHA256:gP6opHVPcRQWO2nBbCcsXmXLtGrxzdRbP+frT4AAJFs
3 changed files with 502 additions and 0 deletions

View file

@ -0,0 +1,153 @@
{
lib,
fetchFromGitHub,
fetchzip,
buildFHSEnv,
buildDotnetModule,
dotnetCorePackages,
luajitPackages,
sqlite,
libarchive,
curl,
love,
xdg-utils,
writeShellScript,
# These need overriding if you launch Celeste/Loenn/MiniInstaller from Olympus.
# Some examples:
# - null: Use default wrapper.
# - "": Do not use wrapper.
# - steam-run: Use steam-run.
# - "steam-run": Use steam-run command available from PATH.
# - writeShellScriptBin { ... }: Use a custom script.
# - ./my-wrapper.sh: Use a custom script.
# In any case, it can be overridden at runtime by OLYMPUS_{CELESTE,LOENN,MINIINSTALLER}_WRAPPER.
celesteWrapper ? null,
loennWrapper ? null,
miniinstallerWrapper ? null,
skipHandlerCheck ? false, # whether to skip olympus xdg-mime check, true will override it
}:
let
lua_cpath =
with luajitPackages;
lib.concatMapStringsSep ";" getLuaCPath [
(buildLuarocksPackage {
pname = "lsqlite3";
version = "0.9.6-1";
src = fetchzip {
url = "https://lua.sqlite.org/home/zip/lsqlite3_v096.zip";
hash = "sha256-Mq409A3X9/OS7IPI/KlULR6ZihqnYKk/mS/W/2yrGBg=";
};
buildInputs = [ sqlite.dev ];
})
lua-subprocess
nfd
];
# When installing Everest, Olympus uses MiniInstaller, which is dynamically linked.
miniinstaller-fhs = buildFHSEnv {
pname = "olympus-miniinstaller-fhs";
inherit version;
targetPkgs =
pkgs:
(with pkgs; [
icu
openssl
dotnet-runtime # Without this, MiniInstaller will install dotnet itself.
]);
};
wrapper-to-env =
wrapper:
if lib.isDerivation wrapper then
lib.getExe wrapper
else if wrapper != null then
wrapper
else
"";
miniinstaller-wrapper =
if miniinstallerWrapper == null then
(writeShellScript "miniinstaller-wrapper" "exec ${lib.getExe miniinstaller-fhs} -c \"$@\"")
else
(wrapper-to-env miniinstallerWrapper);
pname = "olympus";
phome = "$out/lib/${pname}";
# The following variables are to be updated by the update script.
version = "25.02.07.01";
buildId = "4624"; # IMPORTANT: This line is matched with regex in update.sh.
rev = "f4cd9dc973e68dc9b6c043941d5ab57f93b63ac4";
in
buildDotnetModule {
inherit pname version;
src = fetchFromGitHub {
inherit rev;
owner = "EverestAPI";
repo = "Olympus";
fetchSubmodules = true; # Required. See upstream's README.
hash = "sha256-I0tDqe7XvieL0kj8njzaNx3taY2VpFewi/SnYRCi4tk=";
};
nativeBuildInputs = [
libarchive # To create the .love file (zip format).
];
nugetDeps = ./deps.json;
projectFile = "sharp/Olympus.Sharp.csproj";
executables = [ ];
installPath = "${placeholder "out"}/lib/${pname}/sharp";
# See the 'Dist: Update src/version.txt' step in azure-pipelines.yml from upstream.
preConfigure = ''
echo ${version}-nixos-${buildId}-${builtins.substring 0 5 rev} > src/version.txt
'';
# The script find-love is hacked to use love from nixpkgs.
# It is used to launch Loenn from Olympus.
# I assume --fused is so saves are properly made (https://love2d.org/wiki/love.filesystem).
preInstall = ''
mkdir -p ${phome}
makeWrapper ${lib.getExe love} ${phome}/find-love \
--add-flags "--fused"
mkdir -p $out/bin
makeWrapper ${phome}/find-love $out/bin/olympus \
--prefix LUA_CPATH ";" "${lua_cpath}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ curl ]}" \
--suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \
--set-default OLYMPUS_MINIINSTALLER_WRAPPER "${miniinstaller-wrapper}" \
--set-default OLYMPUS_CELESTE_WRAPPER "${wrapper-to-env celesteWrapper}" \
--set-default OLYMPUS_LOENN_WRAPPER "${wrapper-to-env loennWrapper}" \
--set-default OLYMPUS_SKIP_SCHEME_HANDLER_CHECK ${if skipHandlerCheck then "1" else "0"} \
--add-flags ${phome}/olympus.love \
--set DOTNET_ROOT ${dotnetCorePackages.runtime_8_0}/share/dotnet
bsdtar --format zip --strip-components 1 -cf ${phome}/olympus.love src
'';
postInstall = ''
install -Dm644 lib-linux/olympus.desktop $out/share/applications/olympus.desktop
install -Dm644 src/data/icon.png $out/share/icons/hicolor/128x128/apps/olympus.png
install -Dm644 LICENSE $out/share/licenses/${pname}/LICENSE
'';
passthru.updateScript = ./update.sh;
meta = {
description = "Cross-platform GUI Everest installer and Celeste mod manager";
homepage = "https://github.com/EverestAPI/Olympus";
downloadPage = "https://everestapi.github.io/#olympus";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
ulysseszhan
petingoso
];
mainProgram = "olympus";
platforms = lib.platforms.unix;
badPlatforms = lib.platforms.aarch; # Celeste doesn't support aarch in the first place
};
}

317
packages/olympus/deps.json Normal file
View file

@ -0,0 +1,317 @@
[
{
"pname": "Microsoft.NETCore.Platforms",
"version": "1.1.0",
"hash": "sha256-FeM40ktcObQJk4nMYShB61H/E8B7tIKfl9ObJ0IOcCM="
},
{
"pname": "Microsoft.NETCore.Targets",
"version": "1.1.0",
"hash": "sha256-0AqQ2gMS8iNlYkrD+BxtIg7cXMnr9xZHtKAuN4bjfaQ="
},
{
"pname": "Mono.Cecil",
"version": "0.11.4",
"hash": "sha256-HrnRgFsOzfqAWw0fUxi/vkzZd8dMn5zueUeLQWA9qvs="
},
{
"pname": "MonoMod",
"version": "22.1.4.3",
"hash": "sha256-kindD5YUjBWsopvEnmOL4XsldgwE1zRrmMxIh6nDua8="
},
{
"pname": "MonoMod.RuntimeDetour",
"version": "22.1.4.3",
"hash": "sha256-m7FN3SGME4GRGuc7l5ClCT9W3mXqbbhAJHHpWwYqLi8="
},
{
"pname": "MonoMod.RuntimeDetour.HookGen",
"version": "22.1.4.3",
"hash": "sha256-DuOnuXQcS63Z/y5s3q5FHZiqWTPgayNpylkzRzl6pE4="
},
{
"pname": "MonoMod.Utils",
"version": "22.1.4.3",
"hash": "sha256-0KyqozOCC26+z5+Ah35iFvRwrPXvvxDlEq6gLl5lPNU="
},
{
"pname": "Newtonsoft.Json",
"version": "13.0.1",
"hash": "sha256-K2tSVW4n4beRPzPu3rlVaBEMdGvWSv/3Q1fxaDh4Mjo="
},
{
"pname": "runtime.any.System.Collections",
"version": "4.3.0",
"hash": "sha256-4PGZqyWhZ6/HCTF2KddDsbmTTjxs2oW79YfkberDZS8="
},
{
"pname": "runtime.any.System.Globalization",
"version": "4.3.0",
"hash": "sha256-PaiITTFI2FfPylTEk7DwzfKeiA/g/aooSU1pDcdwWLU="
},
{
"pname": "runtime.any.System.IO",
"version": "4.3.0",
"hash": "sha256-vej7ySRhyvM3pYh/ITMdC25ivSd0WLZAaIQbYj/6HVE="
},
{
"pname": "runtime.any.System.Reflection",
"version": "4.3.0",
"hash": "sha256-ns6f++lSA+bi1xXgmW1JkWFb2NaMD+w+YNTfMvyAiQk="
},
{
"pname": "runtime.any.System.Reflection.Extensions",
"version": "4.3.0",
"hash": "sha256-Y2AnhOcJwJVYv7Rp6Jz6ma0fpITFqJW+8rsw106K2X8="
},
{
"pname": "runtime.any.System.Reflection.Primitives",
"version": "4.3.0",
"hash": "sha256-LkPXtiDQM3BcdYkAm5uSNOiz3uF4J45qpxn5aBiqNXQ="
},
{
"pname": "runtime.any.System.Resources.ResourceManager",
"version": "4.3.0",
"hash": "sha256-9EvnmZslLgLLhJ00o5MWaPuJQlbUFcUF8itGQNVkcQ4="
},
{
"pname": "runtime.any.System.Runtime",
"version": "4.3.0",
"hash": "sha256-qwhNXBaJ1DtDkuRacgHwnZmOZ1u9q7N8j0cWOLYOELM="
},
{
"pname": "runtime.any.System.Runtime.Handles",
"version": "4.3.0",
"hash": "sha256-PQRACwnSUuxgVySO1840KvqCC9F8iI9iTzxNW0RcBS4="
},
{
"pname": "runtime.any.System.Runtime.InteropServices",
"version": "4.3.0",
"hash": "sha256-Kaw5PnLYIiqWbsoF3VKJhy7pkpoGsUwn4ZDCKscbbzA="
},
{
"pname": "runtime.any.System.Text.Encoding",
"version": "4.3.0",
"hash": "sha256-Q18B9q26MkWZx68exUfQT30+0PGmpFlDgaF0TnaIGCs="
},
{
"pname": "runtime.any.System.Threading.Tasks",
"version": "4.3.0",
"hash": "sha256-agdOM0NXupfHbKAQzQT8XgbI9B8hVEh+a/2vqeHctg4="
},
{
"pname": "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-LXUPLX3DJxsU1Pd3UwjO1PO9NM2elNEDXeu2Mu/vNps="
},
{
"pname": "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-qeSqaUI80+lqw5MK4vMpmO0CZaqrmYktwp6L+vQAb0I="
},
{
"pname": "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-SrHqT9wrCBsxILWtaJgGKd6Odmxm8/Mh7Kh0CUkZVzA="
},
{
"pname": "runtime.native.System",
"version": "4.3.0",
"hash": "sha256-ZBZaodnjvLXATWpXXakFgcy6P+gjhshFXmglrL5xD5Y="
},
{
"pname": "runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-Jy01KhtcCl2wjMpZWH+X3fhHcVn+SyllWFY8zWlz/6I="
},
{
"pname": "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-wyv00gdlqf8ckxEdV7E+Ql9hJIoPcmYEuyeWb5Oz3mM="
},
{
"pname": "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-zi+b4sCFrA9QBiSGDD7xPV27r3iHGlV99gpyVUjRmc4="
},
{
"pname": "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-gybQU6mPgaWV3rBG2dbH6tT3tBq8mgze3PROdsuWnX0="
},
{
"pname": "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-VsP72GVveWnGUvS/vjOQLv1U80H2K8nZ4fDAmI61Hm4="
},
{
"pname": "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-4yKGa/IrNCKuQ3zaDzILdNPD32bNdy6xr5gdJigyF5g="
},
{
"pname": "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-HmdJhhRsiVoOOCcUvAwdjpMRiyuSwdcgEv2j9hxi+Zc="
},
{
"pname": "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl",
"version": "4.3.0",
"hash": "sha256-pVFUKuPPIx0edQKjzRon3zKq8zhzHEzko/lc01V/jdw="
},
{
"pname": "runtime.unix.System.Diagnostics.Debug",
"version": "4.3.0",
"hash": "sha256-ReoazscfbGH+R6s6jkg5sIEHWNEvjEoHtIsMbpc7+tI="
},
{
"pname": "runtime.unix.System.Private.Uri",
"version": "4.3.0",
"hash": "sha256-c5tXWhE/fYbJVl9rXs0uHh3pTsg44YD1dJvyOA0WoMs="
},
{
"pname": "runtime.unix.System.Runtime.Extensions",
"version": "4.3.0",
"hash": "sha256-l8S9gt6dk3qYG6HYonHtdlYtBKyPb29uQ6NDjmrt3V4="
},
{
"pname": "System.Collections",
"version": "4.3.0",
"hash": "sha256-afY7VUtD6w/5mYqrce8kQrvDIfS2GXDINDh73IjxJKc="
},
{
"pname": "System.Collections.NonGeneric",
"version": "4.3.0",
"hash": "sha256-8/yZmD4jjvq7m68SPkJZLBQ79jOTOyT5lyzX4SCYAx8="
},
{
"pname": "System.Collections.Specialized",
"version": "4.3.0",
"hash": "sha256-QNg0JJNx+zXMQ26MJRPzH7THdtqjrNtGLUgaR1SdvOk="
},
{
"pname": "System.ComponentModel",
"version": "4.3.0",
"hash": "sha256-i00uujMO4JEDIEPKLmdLY3QJ6vdSpw6Gh9oOzkFYBiU="
},
{
"pname": "System.ComponentModel.Primitives",
"version": "4.3.0",
"hash": "sha256-IOMJleuIBppmP4ECB3uftbdcgL7CCd56+oAD/Sqrbus="
},
{
"pname": "System.ComponentModel.TypeConverter",
"version": "4.3.0",
"hash": "sha256-PSDiPYt8PgTdTUBz+GH6lHCaM1YgfObneHnZsc8Fz54="
},
{
"pname": "System.Diagnostics.Debug",
"version": "4.3.0",
"hash": "sha256-fkA79SjPbSeiEcrbbUsb70u9B7wqbsdM9s1LnoKj0gM="
},
{
"pname": "System.Globalization",
"version": "4.3.0",
"hash": "sha256-caL0pRmFSEsaoeZeWN5BTQtGrAtaQPwFi8YOZPZG5rI="
},
{
"pname": "System.Globalization.Extensions",
"version": "4.3.0",
"hash": "sha256-mmJWA27T0GRVuFP9/sj+4TrR4GJWrzNIk2PDrbr7RQk="
},
{
"pname": "System.IO",
"version": "4.3.0",
"hash": "sha256-ruynQHekFP5wPrDiVyhNiRIXeZ/I9NpjK5pU+HPDiRY="
},
{
"pname": "System.IO.FileSystem.Primitives",
"version": "4.3.0",
"hash": "sha256-LMnfg8Vwavs9cMnq9nNH8IWtAtSfk0/Fy4s4Rt9r1kg="
},
{
"pname": "System.Linq",
"version": "4.3.0",
"hash": "sha256-R5uiSL3l6a3XrXSSL6jz+q/PcyVQzEAByiuXZNSqD/A="
},
{
"pname": "System.Private.Uri",
"version": "4.3.0",
"hash": "sha256-fVfgcoP4AVN1E5wHZbKBIOPYZ/xBeSIdsNF+bdukIRM="
},
{
"pname": "System.Reflection",
"version": "4.3.0",
"hash": "sha256-NQSZRpZLvtPWDlvmMIdGxcVuyUnw92ZURo0hXsEshXY="
},
{
"pname": "System.Reflection.Emit.ILGeneration",
"version": "4.7.0",
"hash": "sha256-GUnQeGo/DtvZVQpFnESGq7lJcjB30/KnDY7Kd2G/ElE="
},
{
"pname": "System.Reflection.Emit.Lightweight",
"version": "4.7.0",
"hash": "sha256-V0Wz/UUoNIHdTGS9e1TR89u58zJjo/wPUWw6VaVyclU="
},
{
"pname": "System.Reflection.Extensions",
"version": "4.3.0",
"hash": "sha256-mMOCYzUenjd4rWIfq7zIX9PFYk/daUyF0A8l1hbydAk="
},
{
"pname": "System.Reflection.Primitives",
"version": "4.3.0",
"hash": "sha256-5ogwWB4vlQTl3jjk1xjniG2ozbFIjZTL9ug0usZQuBM="
},
{
"pname": "System.Reflection.TypeExtensions",
"version": "4.7.0",
"hash": "sha256-GEtCGXwtOnkYejSV+Tfl+DqyGq5jTUaVyL9eMupMHBM="
},
{
"pname": "System.Resources.ResourceManager",
"version": "4.3.0",
"hash": "sha256-idiOD93xbbrbwwSnD4mORA9RYi/D/U48eRUsn/WnWGo="
},
{
"pname": "System.Runtime",
"version": "4.3.0",
"hash": "sha256-51813WXpBIsuA6fUtE5XaRQjcWdQ2/lmEokJt97u0Rg="
},
{
"pname": "System.Runtime.Extensions",
"version": "4.3.0",
"hash": "sha256-wLDHmozr84v1W2zYCWYxxj0FR0JDYHSVRaRuDm0bd/o="
},
{
"pname": "System.Runtime.Handles",
"version": "4.3.0",
"hash": "sha256-KJ5aXoGpB56Y6+iepBkdpx/AfaJDAitx4vrkLqR7gms="
},
{
"pname": "System.Runtime.InteropServices",
"version": "4.3.0",
"hash": "sha256-8sDH+WUJfCR+7e4nfpftj/+lstEiZixWUBueR2zmHgI="
},
{
"pname": "System.Text.Encoding",
"version": "4.3.0",
"hash": "sha256-GctHVGLZAa/rqkBNhsBGnsiWdKyv6VDubYpGkuOkBLg="
},
{
"pname": "System.Threading",
"version": "4.3.0",
"hash": "sha256-ZDQ3dR4pzVwmaqBg4hacZaVenQ/3yAF/uV7BXZXjiWc="
},
{
"pname": "System.Threading.Tasks",
"version": "4.3.0",
"hash": "sha256-Z5rXfJ1EXp3G32IKZGiZ6koMjRu0n8C1NGrwpdIen4w="
},
{
"pname": "YamlDotNet",
"version": "9.1.0",
"hash": "sha256-WbMPOLkbyN+SdMrBYuaXV2qKB+bLTV+6RdSFSy/iljk="
}
]

View file

@ -0,0 +1,32 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts nixfmt-rfc-style
set -eu -o pipefail
attr=olympus
nix_file=$(nix-instantiate --eval --strict -A "$attr.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/')
api() {
curl -s "https://dev.azure.com/EverestAPI/Olympus/_apis/$1?api-version=7.1"
}
pipeline_id=$(api pipelines | jq -r '
.value
| map(select(.name == "EverestAPI.Olympus"))
| .[0].id
')
run_id=$(api pipelines/$pipeline_id/runs | jq -r '
.value
| map(select(.result == "succeeded"))
| max_by(.finishedDate)
| .id
')
sed -i 's|buildId\s*=\s*".*";|buildId = "'$run_id'";|' $nix_file
run=$(api pipelines/$pipeline_id/runs/$run_id)
commit=$(echo "$run" | jq -r '.resources.repositories.self.version')
version=$(echo "$run" | jq -r '.name')
update-source-version $attr $version --rev=$commit
"$(nix-build --attr $attr.fetch-deps --no-out-link)"