Nix build from a spago.dhall: the final missing piece

Everyone has always wanted to build PureScript projects with Nix from a spago.dhall file. In the summer of 2019 @justinw released spago2nix which got most of the way there, but had one frustrating impedance: The spago-packages.nix file for the import-from-derivation could not be generated during a Nix derivation. So it has been necessary to regenerate spago-packages.nix by hand every time the spago.dhall changes and check the spago-packages.nix into the repository.

Now, at this late date, this problem has been solved. It’s “late” because the new Registry is going to publish hashes for the PureScript packages which will be available to Nix and the new Spago to make this whole process obsolete. But that solution is not quite online yet, so in the meantime, please enjoy this new flake.nix in spago2nix which publishes a Nix function spago2nix_nativeBuildInputs for building PureScript from a spago.dhall.

8 Likes