Show HN: Garnix, fast and easy CI for Nix
For the past few months, I've been building a Nix-specific CI service, and quite a few people have been productively using it, so I thought I'd Show HN it.
You might be wondering why build a Nix-specific CI. It turns out its quite hard to get a really good CI setup for Nix without spending a lot of time or money on it (or both), and even then solutions don't tend to be optimal.
Garnix, on the other hand, handles everything, and simply. Just create an account, install the GitHub app on the repositories you want, and you're good to go! Each package gets its own GitHub check, and separate log output, which makes it really easy to figure out what went wrong (you can see an example here: https://garnix.io/build/X9knYZOB). Builds are very fast compared to e.g Github Actions. The build artifacts are made available in a Nix cache so you never have to rebuild locally. And there are builders for x86-64 Linux as well as M1 Macs and aarch64 Linux.
Try it out: https://garnix.io. It's free, though if you like it, consider donating! (Note that it only works with flakes.)
Cheers, Julian
64 comments
[ 3.7 ms ] story [ 134 ms ] threadAlso, "gar nichts". But we would say gar nix for short.
(I know Amis people [1], but don't think it would be relevant here).
[1] https://en.wikipedia.org/wiki/Amis_people
> (informal, mildly derogatory) Yank, Yankee, American (native or inhabitant of the USA)
https://en.wiktionary.org/wiki/Ami
[1] https://en.m.wikipedia.org/wiki/Red_Army_Faction
"Ami – go home!" is a popular enough slogan that it has it's own Wikipedia entry[1], unsurprisingly only in German and French.
[1] https://de.m.wikipedia.org/wiki/Ami_–_go_home!
EDIT: For some reason the link doesn't work on HN. Either copy and paste "https://de.m.wikipedia.org/wiki/Ami_–_go_home!" or use https://bit.ly/3CZXNxh
It was in fact from the German. I like the suggestion that the CI should feel like "nothing at all" (rather than the painful slow trial-and-error process of setting up most CIs, which makes you very much aware of them).
I also happen to live very near where Marlene Dietrich lived, who has a famous song in which "und sonst gar nichts/nix" is the refrain ("and nothing else") [0]. When garnix becomes a noun of its own, as here, it reads instead as "and otherwise, garnix", which I find mildly funny.
[0] https://www.youtube.com/watch?v=ahyLLX0tmD8
But is it open-source? I can't find the code.
(In general the idea of a license that's viral like GPL, but oriented towards green and renewable energy, seems like an interesting thought to me.)
We don't care about vendor lock in, we can rewrite the build scripts. We care about support.
Not nearly as bad as writing a bunch of custom github actions or travis CI yaml files and needing to move.
You can replicate garnix's checks with much worse UX and less parallelism on any other service with a few lines of shell calling `nix flake check` and `nix build`. Making the UX good is left as an exercise for the reader.
https://www.gnu.org/licenses/gpl-3.0.en.html
(the GPL version 2 also has this property.)
Also, its unusual license is probably why jslint is not used much.
The reason why it fell mostly in disuse nowadays is because jshint appeared, which allowed a lot more customization of the available rules being applied.
Later eslint popped up with it's plugin engine allowing anyone to have their own custom set of rules.
As far as I know, no one cared about jshint's license because there was no code being shipped, and eventually code would be minified anyway leaving no traces of jshint.
Now... We can talk about the morality of ignoring a license, but ultimately jshint's license was simply ignored by almost everyone
I am from one where we still burn coal for heat (along with plastic bottles, tires, and rubber). You can imagine the impact of the electricity produced here. Yet there are IT jobs here and we're using many of the same products you do.
I've been using Drone and GitLab CI for years and likely won't be using anything like what you're describing because green energy is simply not available, and probably won't be for the next 50 years at the very least.
Hosting CI on the other side of the planet is a no-go for various reasons (we self-host everything since it makes a lot of sense for us).
I think access to software and services shouldn't be be based on the country you happen to live in, and I wouldn't want to contribute to that. But I would have thought either using a hosted service, or else self-hosting in a different country, are almost always options. Why is hosting CI on the other side of the planet for you a no-go?
(Also, I think right now a license that simply says "must be run with renewable energy" is infeasible almost everywhere still.)
[0] https://en.wikipedia.org/wiki/List_of_countries_by_renewable...
I've been working on simplified hosting for nixosConfigurations; likely I'll launch paid plans along with that, since otherwise costs will be too high for me to shoulder, and anyhow free hosting leads to abuse or the moral hazard of accidentally using too many resources. I still have some hope for a donation-based system for individuals, and paid plans for companies, though.
I do think about open-sourcing it as well. I've been thinking about a license that would require only running it (and derived software) on green energy; that way, if competition were to arise, cheaper/dirtier energy wouldn't be what we would be competing on. But figuring out whether that's plausible, and what the consequences of the decision would be, is hard!
It's great in practice, and I would love for all electricity use to be non-renewable, but it's saying that many people in many countries are not allowed to use the software due to something entirely out of their control.
Likely first you'd need some progressive system (e.g.: no less than 80% now, no less than 100% by 2030).
But I disagree with you on that people in many countries would not be allowed to use the software - you would still be able to use the service (i.e., visit garnix.io, have it build things), or even host it yourself in a different country. Yes, countries with more green energy (rather than exclusively cheap energy) would benefit. But the countries with high green/renewable energy aren't even primarily rich ones [0], so I don't feel too bad about that.
Note that this argument only applies to services such as garnix, where you can still use the service (so it would be a bad license for, for example, a text editor).
[0] https://en.wikipedia.org/wiki/List_of_countries_by_renewable...
Which in a way is nice as it enables areas that can't have clean energy (locally) to use clean energy (remotely) via the hosted version, which maybe they otherwise would not, so hopefully acts as an incentive to reward clean energy generation and services wherever they may be (and maybe increase interest in clean energy generation locally if/when that becomes possible in such areas)
This is supposed to say "renewable" rather than "non-renewable"
[0] https://github.com/garnix-io/issues/issues/21
How is that? You run the entire infrastructure on solar panels or something?
I've been wanting to write a blog post about what this means and how much it matters in practice, but there's a lot of research to do still. If someone here works in the area, please get in touch!
David Roberts, a very wonky and wonderful climate journalist, had Google's director of energy on his podcast to talk about Google's goal of having all their data centers operate on 24/7 CFE. This podcast is why I'm surprised any hosting provider has managed to do achieve 24/7 CFE because its an order or magnitude more difficult than achieving "100% CFE".
Here is the link to that episode: https://www.volts.wtf/p/volts-podcast-michael-terrell-on#det...
If you're interested in this enough to choose your hosting provider based off their energy mix I think you'd really enjoy his substack and podcast.
For other comment readers if you the difference between 100% CFE and 24/7 isn't clear, Google's blog post announcing their goal of 24/7 CFE explains the difference between the two and why 24/7 CFE is waaaay more difficult and currently only something a company with Google's resources could do.
Smells a bit like greenwashing to me...
There are of course situations in which you'd prefer that, though!
Also, for whatever reason (in addition to the specific ones above), GitHub action runners are just slow...
In short: garnix is faster, has more features, and is easier to set up.
Maybe an analogy: nix is a package-lock.json. Docker is a package.json (with no version bounds) and a node_modules directory. You can just copy that node_modules directory around so everyone has the same setup, but it's much harder to introspect than a lock file, and the way you go about updating it is deleting the folder and rebuilding everything - no fine-grained control over one specific dependency.
There's no "FROM ...." for Nix like there is for a Dockerfile?
I just had a play with Garnix - and have to say I am impressed. Nicely executed.
Nice to see nix and flakes hitting hackernews through projects/services like this.