Building old software using Nixpkgs

Hi,

for may day job I’ve inherited a software that, for various reasons, must be compiled on RHEL5, kernel 2.6.x glibc-2.5.x and gcc-4.1, and I’d like, if possible, to maintain it using nixpkgs.

I’ve spent some time trying to make it compile with nixpkgs without success and upgrading is not an option.

Has someone done something similar in the past? Do you have pointers to relevant information?

I am still compiling Firefox-3 with Java-6 (to maintain some old hardware with embedded web-server with Java Applets).
As a pointer, try to dig into old nixpkgs and copy-paste from there
The language has not changed a lot and the old nix derivations are mostly compileable

You could import just the compiler from an older revision of nixpkgs:

oldPkgs = builtins.fetchGit { url = https://github.com/NixOS/nixpkgs-channels.git; ref = "nixos-17.09"; }