-
Notifications
You must be signed in to change notification settings - Fork 196
Add Nix support #617
Comments
Specifically, nix's new flakes support. Look for flake.nix which specifies all dependencies and how to build. See https://github.com/numtide/nix-unstable-installer#github-actions I see flake.nix emerging as an alternative to docker for repeatable builds across languages. |
I'd also love to see this. Flakes make portable build environments so much easier. |
Until there is official support, are there workarounds? Can I install |
See nix-netlify-poc for a workaround using |
@justinas 404 priv? |
Sorry! Yup, just made the repo public. |
Neat! I guess the next step might be to add the nix store directory to what's cached by netlify somehow? |
Maybe via a JS build plugin wrapper? Also, it looks like the cache dir is |
Playing with the |
Maybe simply Or maybe not. Trying to use https://github.com/jakejarvis/netlify-plugin-cache. This requires me to add a |
Sigh, that doesn't work neither, it seems. I have
and
but I get
without further indication what went wrong. |
maybe it's too big or something along those lines. |
It’s not thaaat big in my small test. Maybe dead symlinks are an issue, or stuff like that. It’s probably too much of an hack anyways, even if it worked. If only using a remote builder would work without downloading all build dependencies first… |
Essentially a follow-up on #187.
To reiterate the reasoning there (and shared in #251 when the Nix PR came up), Nix would be able to "wear several hats" for Netlify's build image.
It allows essentially infinite flexibility in builds, although it would largely be a power-user build tool in comparison to most of Netlify's other offerings. On the other hand, a well-designed Nix build would be able to afford a high level of granularity in rebuilding unchanged code.
It also addresses the issue with extending Netlify's build image further (and manually) for specific static site generators, instead leaving that ability in the hands of the user. It would be a drastic action, but you could likely remove every single dependency added to the build image and alternatively support it with Nix instead and lose no performance, except for power users who currently have to find their own (likely not performance-sensitive) workarounds in the first place.
Thorough caching support would have to interlink with Netlify's own internal infrastructure, so I'd personally be uncomfortable writing up a PR without consulting with Netlify employees to ensure solid caching -- to lack it would certainly increase build times -- but Nix support would frankly put Netlify head and tail ahead of every other JAMStack provider I'm aware of in the field of user flexibility.
The text was updated successfully, but these errors were encountered: