| 24 Jul 2025 |
Keeton Brewster | There seems to be a thousand ways to do it which is confusing for a newbie | 01:56:06 |
| bglgwyng joined the room. | 05:41:12 |
bglgwyng | Hello! I'm trying to build a nixpkgs.haskellPackages from an arbitrary stackage snapshot. I just found regenerate-hackage-packages.sh in nixpkgs and also hackage2nix in cabal2nix. Is hackage2nix enough for my purpose? I don't fully understand how two tools differ. | 05:54:08 |
maralorn | @keetonbrewster:matrix.org haskell4nix.readthedocs.io is outdated. It's uptodate version is the nixpkgs manual Haskell section. | 06:07:02 |
maralorn | In reply to @bglgwyng:matrix.org Hello! I'm trying to build a nixpkgs.haskellPackages from an arbitrary stackage snapshot. I just found regenerate-hackage-packages.sh in nixpkgs and also hackage2nix in cabal2nix. Is hackage2nix enough for my purpose? I don't fully understand how two tools differ. Huh, I don't think we expect downstream users of hackage2nix. I fear that you won't get very far. But if you really want do this the easiest way would probably be to look at the update stackage script in nixpkgs modify it to not use the newest but your desired snapshot, run it and then run the regenerate script. You can think of the regenerate script as running hackage2nix with all correct configuration for nixpkgs in place. Running hackage2nix without it would probably require duplicating parts of it. | 06:15:22 |
bglgwyng | What if I want to avoid making my own version of nixpkgs? I prefer more local apporach such as generating .nix file that can be used to replace nixpkgs.haskellPackage. Can I do the same thing using 'regenerate-hackage-packages'? | 06:45:03 |
maralorn | It's not meant to be used that way, no. But maybe you can take it as an inspiration. Maybe you want to have a look at stacklock2nix it might be closer to your needs. | 06:47:25 |
bglgwyng | Do you mean https://github.com/cdepillabout/stacklock2nix this repo? | 06:59:05 |