essential-contributions / essential-integration

Integration of Pint and the Essential protocol.
Apache License 2.0
3 stars 1 forks source link

Nix for app devs #42

Open freesig opened 3 months ago

freesig commented 3 months ago

It would be good to have nice simple nix commands that could get app devs everything that need, depending on what they are building. See the following convo for more context.


We could:

  1. Re-export pint and the essential-server packages from the essential-integration flake so that they're all available from a single location.
  2. Add a tip on how users can add the essential-integration flake as a custom "registry" called essential. I personally add registries declaratively in my config, but it looks like you can do it imperatively which is likely easier for users new to nix: https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-registry-add#examples

Then (when public) it would be something like:

$ nix registry add essential github:essential-contributions/essential-integration

$ nix run essential#pint -- --help

$ nix run essential#essential-rest-server

# etc

Remember we can also use the essential-all package to bring all of these tools into scope at once. I think it's currently the default package, so it would look like:

$ nix shell essential

$ pint --help

$ essential-rest-server --help

# etc

Like you mention, if we want to, we could expose different sets of packages in this way depending on what the user is devving (JS, Rust, scripting, etc).

Having templates is a sweet idea too! They could also be exposed from the flake in a similar manner, e.g. if you like the Nix experience and you want a nix flake for your new app, you could do something like:

$ nix flake new --template essential#js-app foobar

or

$ nix flake init --template essential#rust-app

_Originally posted by @mitchmindtree in https://github.com/essential-contributions/essential-integration/pull/41#discussion_r1664989804_