mitchellh / flask-nix-example

Home Page:https://mitchellh.com/writing/nix-with-dockerfiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expand the example to a more complex project?

whacked opened this issue · comments

This is a wishful feature request.

I landed here after reading your blog post. The nix build worked as-is. That's the first example I found that's self contained, reasonably grokkable, and Just Works. The forum discussions are often inscrutable to light users like me.

Using your example as a starting point I tried to adapt it to another more complex project, and almost immediately I hit edge cases. After several hours of digging, I concluded I can't fully argue in favor of this method. And we haven't even brought up other parts of the stack.

So the request is for sharing any useful techniques for expanding the pyproject.toml and possibly dealing with weird libraries; if you have introduced this to a team, how to migrate without scaring everybody off, and possibly how to add more components to the stack.

The multi stage build example is amazing, but if we assume most of the dev environments out there are impure, the most expedient way for containers I know of would be "dumping" the devShell. This method has always worked for me, although it feels dirty. Would love to know if there's another compromise between the mostly pure multi-stage and the mostly impure dump.

Thanks for your blog post!

With the caveat that I'm not very familiar with poetry2nix -- but have always found it to be difficult -- after lots of trial and error, it looks like a really hard sell right now. But here's a crack at the "compromise" method: https://github.com/whacked/mixed-nix-docker-example

Since a lot of my quick and dirty devShell dump containers have easily been 10+GB, this looks promising!