Files
nixos/lib/overlays.nix
Simon Gardling 87e606c6b6 optiscaler: package v0.9.1
stdenvNoCC + p7zip extraction; strips installer scripts and README,
keeps Licenses/. dontFixup since the artifacts are Windows DLLs.
meta.license is unfreeRedistributable to reflect the bundled XeSS
(Intel SLA) alongside the GPL-3.0 source.

Wires lib/overlays.nix into mkDesktopHost (was muffin-only) and adds
"optiscaler" to the unfree allowlist on jovian hosts so yarn can
consume it without flipping the global allowUnfree flag.
2026-05-03 00:35:49 -04:00

157 lines
4.7 KiB
Nix

final: prev: {
ensureZfsMounts = prev.writeShellApplication {
name = "zfsEnsureMounted";
runtimeInputs = with prev; [
zfs
gawk
coreutils
];
text = ''
#!/bin/sh
if [[ "$#" -eq "0" ]]; then
echo "no arguments passed"
exit 1
fi
MOUNTED=$(zfs list -o mountpoint,mounted -H | awk '$NF == "yes" {NF--; print}')
MISSING=""
for target in "$@"; do
if ! grep -Fxq "$target" <<< "$MOUNTED"; then
MISSING="$MISSING $target"
fi
done
if [[ -n "$MISSING" ]]; then
echo "FAILURE, missing:$MISSING" 1>&2
exit 1
fi
'';
};
reflac = prev.writeShellApplication {
name = "reflac";
runtimeInputs = with prev; [ flac ];
excludeShellChecks = [ "2086" ];
text = builtins.readFile (
prev.fetchurl {
url = "https://raw.githubusercontent.com/chungy/reflac/refs/heads/master/reflac";
sha256 = "61c6cc8be3d276c6714e68b55e5de0e6491f50bbf195233073dbce14a1e278a7";
}
);
};
jellyfin-exporter = prev.buildGoModule rec {
pname = "jellyfin-exporter";
version = "unstable-2025-03-27";
src = prev.fetchFromGitHub {
owner = "rebelcore";
repo = "jellyfin_exporter";
rev = "8e3970cb1bdf3cb21fac099c13072bb7c1b20cf9";
hash = "sha256-wDnhepYj1MyLRZlwKfmwf4xiEEL3mgQY6V+7TnBd0MY=";
};
vendorHash = "sha256-e08u10e/wNapNZSsD/fGVN9ybMHe3sW0yDIOqI8ZcYs=";
# upstream tests require a running Jellyfin instance
doCheck = false;
meta.mainProgram = "jellyfin_exporter";
};
igpu-exporter = prev.buildGoModule rec {
pname = "igpu-exporter";
version = "unstable-2025-03-27";
src = prev.fetchFromGitHub {
owner = "mike1808";
repo = "igpu-exporter";
rev = "db2dace1a895c2b950f6d3ba1a2e46729251d124";
hash = "sha256-xWTiu26UzTZIK/6jeda+x6VePUgoWTS0AekejFdgFWs=";
};
vendorHash = "sha256-oeCSKwDKVwvYQ1fjXXTwQSXNl/upDE3WAAk680vqh3U=";
subPackages = [ "cmd" ];
postInstall = ''
mv $out/bin/cmd $out/bin/igpu-exporter
'';
meta.mainProgram = "igpu-exporter";
};
mc-monitor = prev.buildGoModule rec {
pname = "mc-monitor";
version = "0.16.1";
src = prev.fetchFromGitHub {
owner = "itzg";
repo = "mc-monitor";
rev = version;
hash = "sha256-/94+Z9FTFOzQHynHiJuaGFiidkOxmM0g/FIpHn+xvJM=";
};
vendorHash = "sha256-qq7rIpvGRi3AMnBbi8uAhiPcfSF4McIuqozdtxB5CeQ=";
# upstream tests probe live Minecraft servers
doCheck = false;
meta.mainProgram = "mc-monitor";
};
# OptiScaler: universal upscaler/frame-gen middleware. Bridges DLSS, XeSS,
# and FSR backends so games shipping older upscalers can be retargeted at,
# e.g., FSR 4 (RDNA 4 native, RDNA 3 INT8 via Mesa+Proton).
#
# Bundled binaries are unaudited Windows DLLs intended to be loaded under
# Wine/Proton. The release tarball ships its own license tree which we
# carry through verbatim under $out/Licenses for compliance.
#
# Bumping: drop the new asset URL + recompute hash. Verify $out still
# contains OptiScaler.dll and OptiScaler.ini (consumers reference both by
# name).
optiscaler = prev.stdenvNoCC.mkDerivation rec {
pname = "optiscaler";
version = "0.9.1";
src = prev.fetchurl {
url = "https://github.com/optiscaler/OptiScaler/releases/download/v${version}/Optiscaler_${version}-final.20260427._DSB.7z";
hash = "sha256-VtGhjjoy2XjAE0hE6AO6jPBBNCJs/NuCg/aNGAg2+rA=";
};
nativeBuildInputs = [ prev.p7zip ];
unpackPhase = ''
runHook preUnpack
mkdir -p source
7z x -bd -o"source" $src >/dev/null
runHook postUnpack
'';
sourceRoot = "source";
dontConfigure = true;
dontBuild = true;
# Windows DLLs; nothing to patchelf or strip.
dontFixup = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r ./* $out/
# The installer scripts and "extract me" README aren't useful at runtime.
rm -f $out/setup_linux.sh $out/setup_windows.bat
rm -f "$out/!! README_EXTRACT ALL FILES TO GAME FOLDER !!.txt"
runHook postInstall
'';
meta = with prev.lib; {
description = "Upscaler/frame-gen middleware bridging DLSS, XeSS, and FSR backends";
homepage = "https://github.com/optiscaler/OptiScaler";
# OptiScaler proper is GPL-3.0-or-later. The bundled FidelityFX SDK is
# MIT-0; XeSS ships its own Intel SLA. License texts are preserved at
# $out/Licenses/.
license = with licenses; [
gpl3Plus
mit0
unfreeRedistributable
];
sourceProvenance = [ sourceTypes.binaryNativeCode ];
platforms = platforms.linux;
maintainers = [ ];
};
};
}