News for hackers. Stuff that matters.
Re:Stripe's Monorepo Developer Environment by stavros on Monday August 19, 2024 @05:12AM (#41289284)
Nix is the right tool for this, developing a tool to make Nix's UX easier is a great idea. Thanks for this!
Re:Stripe's Monorepo Developer Environment by dirtbag__dad on Monday August 19, 2024 @05:18AM (#41289315)
What about dev containers?
Re:Stripe's Monorepo Developer Environment by stavros on Monday August 19, 2024 @06:38AM (#41289734)
You mean Docker? They tend to rot much more than I'd like, mostly because you forget to pin something at some point. With Nix, you can't forget.
Re:Stripe's Monorepo Developer Environment by janjongboom on Monday August 19, 2024 @07:22AM (#41290011)
FYI, I've helped set up StableBuild (https://www.stablebuild.com) to help pin stuff in Docker that's normally virtually impossible to pin (e.g. OS package repos, Docker base images, random files from the internet, etc.)
Re:Stripe's Monorepo Developer Environment by 1oooqooq on Monday August 19, 2024 @09:09AM (#41290741)
did the word rot change meaning recently?

pin is what causes rot, not what solves it.

Re:Stripe's Monorepo Developer Environment by otabdeveloper4 on Monday August 19, 2024 @11:10AM (#41291714)
Good luck with your Docker containers in three years. (You're gonna need it.)
Re:Stripe's Monorepo Developer Environment by 0x457 on Monday August 19, 2024 @01:43PM (#41293026)
Different kind of rot. With nix and flakes, I can come back to a project 5 years later and as long as external dependencies (i.e. package sources) still available it will bring me back straight to that environment like it was yesterday.

If you have a Dockerfile from 5 years ago...well good luck building it today.

Re:Stripe's Monorepo Developer Environment by 1oooqooq on Wednesday August 21, 2024 @08:09AM (#41309453)
my point stands, it's still trying to lie about the meaning of the word rot. it's just as delusional as docker original "rotting software will run in 5yrs" argument... nothing there goes against rot
Re:Stripe's Monorepo Developer Environment by dirtbag__dad on Tuesday August 20, 2024 @12:32AM (#41296834)
Err — sorry I mean https://containers.dev/

Which has pretty nice support across IDEs. For example - https://code.visualstudio.com/docs/devcontainers/containers

I set this up for my last company where we had all sorts of “works on my machine issues” and a needlessly painful onboarding experience. Local development became streamlined with this tooling BUT pre-apple silicon macs couldn’t handle running Docker like this. Glacially slow. We had a python monorepo with a bunch of services within it.

I am curious whether nix is an alternative / improvement for this. Was going down the nix road at first but an infrastructure team member steered me toward devcontainers instead and I’ve been pretty happy since!

Re:Stripe's Monorepo Developer Environment by ParetoOptimal on Monday August 19, 2024 @08:44AM (#41290560)
You can create them with devenv, but they are actually reproducible :

https://devenv.sh/containers/

https://devenv.sh/integrations/codespaces-devcontainer/

Re:Stripe's Monorepo Developer Environment by 1oooqooq on Monday August 19, 2024 @09:07AM (#41290727)
i missed any description of the actual container content on those examples.
Re:Stripe's Monorepo Developer Environment by 0x457 on Monday August 19, 2024 @01:41PM (#41293004)
IIRC, it uses what is defined for shell environment. Just instead of activating on your machine, it produces OCI image with that environment.

I have nixOS definitions that I can use to make a SD card image, overtake a running linux system via ssh, deploy to nixos via ssh, or deploy to a local system - all from one definition.

Re:Stripe's Monorepo Developer Environment by pxc on Monday August 19, 2024 @06:14PM (#41295013)
Containers are a great deployment target, but they're not really a great development environment for a few reasons (e.g., they're Linux-specific, so they require extra virtualization on non-Linux operating systems, the kind of isolation they provide is more of a hindrance than a help when it comes to working on your local filesystem, and for them to be useful you have to set up infrastructure to push and pull your private containers to and from).

Nix is a better fit for this, and when you're using Nix you can also have Nix generated containers for deployment. I think you can also use a container with Nix in to provide the devcontainers interface to devs who don't have Nix installed locally, and have it in turn use Nix against your project's flake to set up its environment.

Re:Stripe's Monorepo Developer Environment by eadmund on Monday August 19, 2024 @09:31AM (#41290918)
> Nix is the right tool for this

Or Guix, which has the advantage of a more pleasant language.

Re:Stripe's Monorepo Developer Environment by otabdeveloper4 on Monday August 19, 2024 @11:09AM (#41291699)
That's, like, just your opinion, man.

Scheme and/or Lisp is literally the worst language choice for this problem domain.

Re:Stripe's Monorepo Developer Environment by 0x457 on Monday August 19, 2024 @01:37PM (#41292971)
I wouldn't say it's the worst. I don't like Lisp and co, but I think it's alright for this. I don't like Guix for a very different reason.
Re:Stripe's Monorepo Developer Environment by ParetoOptimal on Monday August 19, 2024 @03:59PM (#41294130)
Why is Lisp the worst for this problem domain?

I will admit I find guix to be much more verbose than Nix.

Re:Stripe's Monorepo Developer Environment by otabdeveloper4 on Thursday August 22, 2024 @04:29AM (#41318009)
For starters, a configuration language needs to be lazy by default. (Unless you want to evaluate the whole world every time you change one line.)
Re:Stripe's Monorepo Developer Environment by chpatrick on Monday August 19, 2024 @10:44AM (#41291493)
YMMV, I really don't like lisp braces personally.
Re:Stripe's Monorepo Developer Environment by earthling8118 on Monday August 19, 2024 @09:51AM (#41291061)
The language isn't the problem with nix.
Re:Stripe's Monorepo Developer Environment by 0x457 on Monday August 19, 2024 @01:38PM (#41292981)
It's not "the problem", but it's a problem. It's better than alternatives, but it's hacky nature shows.
Re:Stripe's Monorepo Developer Environment by ParetoOptimal on Monday August 19, 2024 @03:58PM (#41294126)
Well, if you believe:

- discoverability is a problem in Nix

- Guix encourages or "shepherds" more discoverable functions, modules, and abstractions

Then the language could be a problem.

Re:Stripe's Monorepo Developer Environment by nitsky on Monday August 19, 2024 @01:59PM (#41293179)
What is?
Re:Stripe's Monorepo Developer Environment by pxc on Monday August 19, 2024 @06:07PM (#41294955)
At my workplace, Guix's lack of macOS support takes away some of the benefit of using something like Nix or Guix as opposed to HVM solutions like Docker Desktop or Vagrant. I imagine this situation is unfortunately common.

For teams where GNU/Linux is the primary development OS, Guix seems like a great choice.