New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iosevka: Simplify custom build process #69219
Conversation
Although hopefully this can eventually be added to nodePackages, it uses some devDependencies to build custom fonts. Node2nix doesn't currently support enabling devDependencies for a single package. - Got rid of redundant let-in statements. - node-packages.json now only pulls in Iosevka. - generate.sh * Uses a nix-shell shebang to ensure it builds using the current version of node2nix (the old version caused some issues due to the 19.03 release version being 1.6.0 instead of 1.7.0). * Builds in development mode to fix the devDependencies issue. - Use the tree of the built node package as sourceRoot instead of installing node dependencies manually. This means the source will have to be updated in both node-packages.json and default.nix, but to make things easier the derivation inherits the version number. - Disparate build options now all live under privateBuildPlan, which is converted first with builtins.toJSON and then to TOML using remarshal (Unfortunately there is not currently a builtins.toTOML). - Extra parameters can also be provided that will be converted to JSON then TOML. This will overwrite the default parameters.toml file.
@rileyinman You can also add yourself as a maintainer, if you want to. |
Do you want me to force-push to squash these commits? |
Don't worry, we can squash it with github. I cannot merge your PR but it's ok for me. |
With suggestions from @hlolli in #68820, I can try merging the build deps into nodePackages. This would have the disadvantage of having to keep a |
I went ahead and pushed the change up, let me know if there are any objections to this :) |
Very good, this would be the way I would do it. It also locks iosevka's npm dependencies in 1 build dependency. So when bumping this package, it will be a ceremony to compare the package.json files and re-generate the node-packages. But ofc I recommend using node2nix locally for development. The only wart in this process is the fact that the package-name takes the relative local path, other than that, looks good to me :D |
@hlolli do you have any ways the package name thing could be better? I just copied it off what you did in lumo |
Thanks! |
Although hopefully this can eventually be added to nodePackages, it uses
some devDependencies to build custom fonts. Node2nix doesn't currently
support enabling devDependencies for a single package.
version of node2nix (the old version caused some issues due to the
19.03 release version being 1.6.0 instead of 1.7.0).
installing node dependencies manually. This means the source will have
to be updated in both node-packages.json and default.nix, but to make
things easier the derivation inherits the version number.
converted first with builtins.toJSON and then to TOML using remarshal
(Unfortunately there is not currently a builtins.toTOML, see New builtin: toTOML nix#2967).
then TOML. This will overwrite the default parameters.toml file.
Motivation for this change
I was already working on bumping the version when the PR came in a few days ago, but I still had a few improvements I thought would help for the future! Making node2nix and remarshal do most of the work seemed like a good idea.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @cstrahan @jfrankenau @ttuegel @babariviere