-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Generate Hackage/LTS nix expressions on the fly rather than have them in the repo #16130
Copy link
Copy link
Closed
Closed
Copy link
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.6.topic: haskellGeneral-purpose, statically typed, purely functional programming languageGeneral-purpose, statically typed, purely functional programming language
Description
@peti brought up an idea earlier on the IRC channel: if hackage-packages.nix is automatically generated, why does it need to be in the nix repo? Could we instead generate it as a nix derivation which would contain all versions of packages on hackage.
I hacked something together that's very crude, incomplete, and that needs a lot of work before it becomes even remotely serviceable but it illustrates the concept: https://gist.github.com/obadz/347fcf3ef0a86a9dbccbb7b04a80793b
You can inspect the generated nix expressions with:
$ nix-build ./autoHackage.nix -A autoHackageSrcand you can see that at least one package builds by trying:
$ nix-build ./autoHackage.nix -A test-abstract-dequeMaybe we can move hackage-package.nix out of nixpkgs. We can probably do something similar for LTS releases (also @peti's idea).
Notes:
- There's a guard in there so that only packages with names starting in
abare generated. That's just to get rapid feedback while iterating. - If you generate the full hackage package set, it's about 60MB of nix expressions uncompressed
- I used
cabal2nixbut I suspect there are more appropriate tools that I'm just not familiar with to do this - If something like this became
haskellPackages, we'd probably need to have enough packages in "static nix expressions" to buildcabal2nixor any required tooling written in haskell
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.6.topic: haskellGeneral-purpose, statically typed, purely functional programming languageGeneral-purpose, statically typed, purely functional programming language
Fields
Give feedbackNo fields configured for issues without a type.