{ lib, stdenv, fetchFromGitHub, xorg, libpulseaudio, ... }: # TODO: non-Linux OS setup # TODO: insert meta stdenv.mkDerivation rec { pname = "inferno64"; version = "2026-04-29"; src = fetchFromGitHub { owner = "caerwynj"; repo = pname; rev = "8e3a1e2eb576bfbe8a82fa24f89764c41e064ed3"; hash = "sha256-w8sGJ3JfSvdfusejJClT9MWTUA76MNgXOHMJ6cfeHhA"; }; buildInputs = [ libX11 libXext libpulseaudio ]; postPatch = '' sed -i '/types.h/a #include ' ./lib9/create.c sed -i '19a\ -fpermissive\\' ./mkfiles/mkfile-Linux-amd64 ''; configurePhase = '' runHook preConfigure export ROOT="$PWD" export objtype='amd64' export PATH="$PATH:$PWD/Linux/$objtype/bin" ./makemk.sh mk mkdirs runHook postConfigure ''; buildPhase = '' runHook preBuild mk install runHook postBuild ''; installPhase = lib.warn '' All Inferno files are stored under a directory on your filesystem. Nix outputs (under /nix/store) are read-only. To initialize a directory for the Inferno FS, run the "inferno_init" script. '' '' runHook preInstall mkdir -p "$out/usr/inferno" cp -r . "$out/usr/inferno" ln -s "$out/usr/inferno/Linux/amd64/bin" "$out/bin" cat <"$out/bin/inferno_init" #!${stdenv.builder} [ -z "\$1" ] && set '/usr/inferno' [ ! -d "\$1" ] && echo "'\$1' doesn't exist or not a directory!" && exit 1 cp -sr "$out/usr/inferno"/* "\$1" || exit $? find "\$1" -type d -not -path "\$1" -exec chmod +w {} + echo "'\$1' initialised for Inferno!" echo "You're probably planning on using the emulator, just issue:" if [ "\$1" != '/usr/inferno' ] then echo "emu -r '\$1'" else echo 'emu' fi SH chmod +x "$out/bin/inferno_init" runHook postInstall ''; # All (most?) resultant scripts are ran with /dis/sh, # not with /nix/store/...-bash-... dontFixup = true; }