melonDS
melonDS copied to clipboard
Add CI workflow using Nix
If you're not familiar with Nix, it's... a strange beast. Nix refers to both a hybrid package manager and build tool, and to the language its build scripts are written in. Nix' main selling point as a build tool is determinism (they call it "reproducibility"): only explicitly specified libraries are available in $PATH
to e.g. make
, so there are no implicit dependencies on glibc
or whatever.
Anyway, I think all the headache caused by using Ubuntu for CI can be solved by using Nix. As long as the "pinned" nixpkgs hardcoded into the file isn't changed, Qt5 will live forever! (Unfortunately, the CI workflow needs to be Nix in Ubuntu, because the great GitHub gremlins have decided that Docker is unnecessary, and they don't offer Alpine or any other Linux distro.)
I'd be happy to answer any questions about Nix in general—though I'm far from being an expert—or about the expression in my commit. As noted, it's basically the same as the one in the unstable version of NixOS.
Some more notes:
The melonDS expression I copied from nixpkgs seems to work on aarch64
as shown here, and it can probably be cross-compiled from x86_64
. I'm willing to go down the cross-compilation rabbit hole if there's interest in replacing your existing, misbehaving Workflow for ARM with a Nix one.
I'm not experienced enough to attempt this, but I think #751 re: static linking is also possible using Nix.