-
It's not really clear to me now: is there a way, when writing a normal Nix flake, for me to transparently use Nickel to write as much as possible of it? I assume the answer is unfortunately a "no", but I can't be sure until I ask. I assume I can currently only use it in a two-step process, manually pre-generating some JSON with Nickel, committing it into the flake repo, and then having it imported in the Nix flake. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think your best bet might be the organist project, which we also develop at Tweag. It's mostly centered around writing development shells, so depending on what you try to do, it might not be the right solution, but it's probably the most advanced example of Nickel-Nix integration today. Organist have mechanisms to pass derivations between Nix and Nickel (of course, there are many restrictions, but using simple packages without overriding shouldn't be an issue), for example. Even if organist, as it is, doesn't fit your use-case, you might be able to steal ideas and code from its internal library. Organist has a Nix library with functions such as I haven't followed as closely organist development lately, so if you have any technical question specifically related to organist, you might have more luck asking directly there. |
Beta Was this translation helpful? Give feedback.
I think your best bet might be the organist project, which we also develop at Tweag. It's mostly centered around writing development shells, so depending on what you try to do, it might not be the right solution, but it's probably the most advanced example of Nickel-Nix integration today. Organist have mechanisms to pass derivations between Nix and Nickel (of course, there are many restrictions, but using simple packages without overriding shouldn't be an issue), for example.
Even if organist, as it is, doesn't fit your use-case, you might be able to steal ideas and code from its internal library. Organist has a Nix library with functions such as
importFromNcl
which handle a bunch of task…