Skip to content

Instantly share code, notes, and snippets.

@ashleyghooper
Created June 14, 2025 22:56
Show Gist options
  • Save ashleyghooper/0925d79aefadfd2eb202244e8dcc777a to your computer and use it in GitHub Desktop.
Save ashleyghooper/0925d79aefadfd2eb202244e8dcc777a to your computer and use it in GitHub Desktop.
nix flake for ETe (Enemy Territory: Evolved)
{
description = "A flake for building and running ETe (Enemy Territory: Evolved)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachSystem ["x86_64-linux" "i686-linux"] (
system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
ete-etmain-data = pkgs.fetchzip {
url = "https://github.com/etfdevs/ETe/releases/download/latest/ete-etmain-mod-replacement-allplatform.zip";
hash = "sha256-XmFHM/dF3yrdm/+G1xlcBVWynI6c9PhhnruETsGpwXE=";
stripRoot = false;
};
et-pak0 = pkgs.fetchurl {
url = "https://mirror.etlegacy.com/etmain/pak0.pk3";
hash = "sha256-cSlmsg4GUj/oFBlRZQDkmchrK0/sgjhW3b0zP8s9JuU=";
};
et-pak1 = pkgs.fetchurl {
url = "https://mirror.etlegacy.com/etmain/pak1.pk3";
hash = "sha256-VhD9dJAkQFtEJafOY5flgYe5QdIgku8R1IRLQn31Pl0=";
};
et-pak2 = pkgs.fetchurl {
url = "https://mirror.etlegacy.com/etmain/pak2.pk3";
hash = "sha256-pIq3SaGhKrTZE3KGsfI9ZCwp2lmEWyuvyPZOBSzwbz4=";
};
in {
packages.default = pkgs.stdenv.mkDerivation {
pname = "ete-full";
version = "unstable";
src = pkgs.fetchFromGitHub {
owner = "etfdevs";
repo = "ETe";
rev = "master"; # Or a specific commit/tag for reproducibility
hash = "sha256-58Zh4D3Mgk1+iIYBh4vd7+D8UzQfokqMnC9xFtK3E2Y=";
};
nativeBuildInputs = with pkgs; [
cmake
makeWrapper
];
buildInputs = with pkgs; [
curl
libGL
libjpeg
SDL2
xorg.libX11
];
cmakeDir = "../src";
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DBUILD_CLIENT=1"
"-DBUILD_DEDSERVER=1"
"-DBUILD_ETMAIN_MOD=0"
"-DBUILD_FREETYPE=0"
"-DBUILD_GL32=0"
"-DBUILD_SDL=0"
];
installPhase = ''
mkdir -p $out/etmain
# Copy the pre-fetched game data into our package
echo "Copying etmain data..."
cp -r ${ete-etmain-data}/* $out/etmain/
echo "Copying game assets..."
cp -r ${et-pak0} $out/etmain/pak0.pk3
cp -r ${et-pak1} $out/etmain/pak1.pk3
cp -r ${et-pak2} $out/etmain/pak2.pk3
echo "Copy and wrapping binaries..."
for binary in ete.* ete-ded.*; do
mv $binary $out/$binary.real
makeWrapper $out/$binary.real $out/$binary --chdir "$out"
done
'';
meta = {
description = "ETe (Enemy Territory: Evolved) Client";
homepage = "https://github.com/etfdevs/ETe";
license = pkgs.lib.licenses.gpl2Only;
platforms = ["i686-linux" "x86_64-linux"];
mainProgram = "ete";
};
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment