announcing: gleam2nix!

build your gleam applications with nix, and integrate them into your nix-powered workflows! run ci builds with dependency caching, deploy your apps to nixos machines, and take advantage of the wide nix ecosystem in your gleam build process!

check out the documentation at
https://gleam2nix.foxgirl.engineering/
source code:
https://git.isincredibly.gay/srxl/gleam2nix

#gleam #gleamlang #nix #nixos #erlangotp #otp #beam
gleam2nix

tools for building gleam projects with nix

gleam2nix
@srxl love your domain names
@ireneista i have the best domain names ​

@srxl nice! A few years ago (prior to gleam v1.0) I created nix-gleam. Initially I was gonna make a gleam2nix kind of application but found out that I can just read the gleam.toml and manifest.toml and dynamically pull the dependencies that way. Is there a requirement for a nix code generator now?

https://github.com/arnarg/nix-gleam

I don't really write any gleam anymore so it's probably good if someone else is creating a well maintained project for this :) but AFAIK my builder still works.

GitHub - arnarg/nix-gleam: Generic nix builder for gleam applications

Generic nix builder for gleam applications. Contribute to arnarg/nix-gleam development by creating an account on GitHub.

GitHub
@arnar i did see that one, it's pretty nice! informed a good chunk of my earlier experimentations before i discovered the gleam compile-package command.

my goal with gleam2nix is to eventually have something that can be upstreamed to nixpkgs. IFD isn't allowed in there, so I can't rely on the same
importTOMLtechniques that nix-gleam does - going for the classic "*2nix"-style nix codegen was the most obvious way to implement it in an IFD-free way, to my knowledge.

it's definitely a lot more convenient though - at some point, i might add an option to generate the gleam.nix file in a derivation, kinda like what
crate2nix can do (assuming that's allowed upstream. i think it is, because iirc the elixir tooling can do a similar thing).
Generating Cargo.nix via IFD

crate2nix
@srxl I see. That makes sense! Best of luck with that! :)