mkjson: init at 0.4.0#305068
Conversation
There was a problem hiding this comment.
LGTM
Not sure if that’s the right directory …
You might consider adding an update-script, but updating by hand is fine if it doesn’t happen that often.
Maybe you also want to expose a separate bin output as a toplevel attribute, because otherwise this app will have a huge runtime closure.
|
It is not updated often enough for a script to be useful. I can put it in another directory. Which would be the right one? |
|
I mean that hierarchy is cursed either way … I guess the I guess in truth I would prefer all non-hackage-packages to live in the same subfolder. Seeing that all other packages are supposed to move to pkgs/by-name, we ideally hat something like pkgs/haskell/by-name. But at this point this tool seems similar to |
|
Fair enough; I have moved it to |
Does |
|
Perhaps not, but I can't figure out the required plumbing for getting access to all the |
Fun point. I kinda thought that’s how we do it. e.g. nix-output-monitor is packaged this way and I guess that doesn’t actually make sense. @athas It would actually be quite easy to change. Remove the change in non-hackage-packages.nix. And add a
line to Edit: I kinda hope that there is then a way to translate that to pkgs/by-name, it’s probably also easy, but I have never done that. |
|
Hah, there is actually precedent for doing this for a Haskell package. See: https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/ni/nixfmt-rfc-style (you can probably get away with making the package.nix a bit simpler and you don’t need the date.txt and the update.sh) or https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/ln/lngen, which is a bit to simple for my taste, and probably more handwork, but also an option. |
I have been convinced that this doesn’t belong in non-hackage-packages.nix
|
Alright, I have done that. I agree that it feels like the right choice. The fact that it is written in Haskell is just an implementation detail; it should not be part of the package name. |
|
It's probably even better to just have a |
|
Yeah, sorry, @athas, as I am also learning this as we go, but I just wanted to remark the same as sterni. The minimal solution would be a file containing: The only reason that the CI is not screaming at you because you are adding a file to the deprecated all-packages.nix is that it does not know what justStaticExecutables is. |
|
Alright, I have done that. I like this solution. It also makes it very obvious how to override the package to build manpages etc (for packages that have this, which mkjson doesn't). |
|
But you dropped the justStaticExecutables now. I would recommend adding that back. |
|
Strange, I wonder how that happened. |
|
Okay, hopefully last thing from me: You should add this to the tested set of the haskell-updates branch now, because otherwise we won’t notice when we break it. (I thought of this when you opened the PR, but while it was in non-hackage-packages the CI would have picked it up automatically.) The list is here: nixpkgs/pkgs/top-level/release-haskell.nix Line 265 in 50e7020 |
|
I think I did it correctly, but I don't know enough about Hydra to say for sure. |
maralorn
left a comment
There was a problem hiding this comment.
No, one does. :D
But this looks fine. Let’s see if anyone else has opinions on this for a few hours, but imo this is good to go.
|
I suggest documenting this procedure somewhere (no idea where). It's really not a lot of work once you know what to do, but if you look at the existing infrastructure, it looks very Hackage-centric. I can imagine there's a good number of Haskell applications that are not on Hackage because they are not really intended to be libraries. |
Description of changes
Adds a derivation for mkjson. This program is written in Haskell but is not on Hackage, but I find it quite useful. I could not find any normative documentation for how to handle non-Hackage haskell packages, so I imitated the ones I could find.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.