easy-purescript-nix
easy-purescript-nix copied to clipboard
Maintenance of psa, pscid, pulp, purescript-language-server, purs-tidy
So what I have been doing is keeping an uncommitted
package.jsonaround the folders. For instance this inpurs-tidy:{ "name": "purs-tidy", "version": "0.7.1", "dependencies": { "purs-tidy": "0.7.1" } }When I new version comes in, I bump these numbers to match the NPM release. Following this I just run
node2nixwith the latestnode2nixversion (Node v12 is deprecated, andnode2nixseems to favor the latest maintenance version instead of latest LTS).After
node2nixdoes it's thing. I rungit checkouton thedefault.nixto keep the modifications Justin did way back when. Then I go back andnvim default.nixand edit the version number to match thepackage.jsonand generated code.I
git add *.nix,git commitand write my merge request message, thengit push github $BRANCH. The diff this creates is usually minimal which Justin tends to approve of in <48 hours because it's just a few version bumps to read on his end.
Originally posted by @toastal in https://github.com/justinwoo/easy-purescript-nix/issues/146#issuecomment-1083977501
we should write this as a bash script sometime
I’ve been trying to do an import-from-derivation with node2nix for pulp and it’s very hard.
We want:
- When a new version of a package comes out we can edit
default.nixand paste in the new version number and asha256and then commit. - The new version gets the locked versions of NPM dependencies from the
package-lock.json.
Problems:
- We can get hashes for the dependencies from
package-lock.jsonin the source repository, but there is no place to get a hash for the package itself. So there is no way to create a pure derivation for the package. - When we do this with @toastal ’s method then I think we don't get the locked dependency versions from
package-lock.json. - We don't want to build from source because then all the source-building tools have to be in the derivation. So we want the pre-built code from npmjs.com.
(Thank you very much for the work you’ve done on this @toastal )
BTW, I found that I had also used process substitution at one point: node2nix --input (echo '{"name":"purescript-psa",version:"0.8.2",dependencies":{"purescript-psa": "0.8.2"}}' | psub)
There's a new method for maintaining these derivations, see the default.nix files in each package’s directory.
https://github.com/justinwoo/easy-purescript-nix/blob/c8eee8f0df073deedd8d94314a01b76b0d9ff33d/psa/default.nix#L1-L4