Files
homelab/services/desktop/epic-games-launcher.nix
T

71 lines
2.2 KiB
Nix

{ pkgs, lib, ... }:
# Epic Games Launcher Preview (EGLv2): Epic's .deb, run unpatched in the same
# Steam-runtime FHS env as heroic, since the GE-Proton it downloads to
# ~/.local/share/com.epicgames.eglv2/compat needs those libraries too.
# Bump: version + commit from the 303 Location of
# https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncher-x86_64.deb
let
version = "0.115.0";
commit = "gd6d2ef8";
unwrapped = pkgs.stdenvNoCC.mkDerivation {
pname = "epic-games-launcher-unwrapped";
inherit version;
src = pkgs.fetchurl {
url = "https://content-download-egs.distro.on.epicgames.com/Builds/EGLv2/${version}%2B${commit}/Linux/EpicGamesLauncher-x86_64.deb";
hash = "sha256-YYrcC8x3i7sfSXOBENXCGehh7Uy3rbcrJPtVAxVqbWM=";
};
nativeBuildInputs = [ pkgs.dpkg ];
unpackCmd = "dpkg-deb -x $curSrc root";
dontBuild = true;
dontStrip = true;
dontPatchELF = true;
# RUNPATH $ORIGIN/../lib/epic-games-launcher finds the EOS SDK in place.
installPhase = ''
mkdir -p $out
cp -r usr/* $out/
substituteInPlace $out/share/applications/epic-games-launcher.desktop \
--replace-fail "Exec=EpicGamesLauncher" "Exec=epic-games-launcher"
'';
meta = {
description = "Epic Games Launcher Preview";
homepage = "https://store.epicgames.com/download";
license = lib.licenses.unfree;
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
platforms = [ "x86_64-linux" ];
};
};
launcher = pkgs.steam.buildRuntimeEnv {
pname = "epic-games-launcher";
inherit version;
inherit (unwrapped) meta;
runScript = "${unwrapped}/bin/EpicGamesLauncher";
extraPkgs = p: with p; [
webkitgtk_4_1
libsoup_3
gtk3
libayatana-appindicator
libsecret # tokens go to gnome-keyring via org.freedesktop.secrets
xdg-utils
];
# Its updater would write into the store.
extraEnv.EGL_DISABLE_SELF_UPDATE = "1";
extraInstallCommands = ''
mkdir -p $out/share
ln -s ${unwrapped}/share/applications $out/share
ln -s ${unwrapped}/share/icons $out/share
'';
privateTmp = false;
};
in
{
environment.systemPackages = [ launcher ];
}