Hacker News new | past | comments | ask | show | jobs | submit login

I really don't understand why should I use this over plain nix, can you elaborate?



I just want clean, repeatable environments for different projects. I’ve tried getting into Nix a few times but I always get overwhelmed by all the different things it is/does. This looks 100x simpler to me.


Hmm...

I understand that if you don't know anything about the language or what is a flake, it may be a little bit difficult.

But really, adding a new package to your environment once you have a flake setup, which a minimal one is trivial, is just adding the name of the package.

Here you have a flake.nix example from leptos. https://github.com/leptos-rs/leptos/blob/main/flake.nix

You want a new dependency? Add it to buildInputs. (this one doesn't have packages setup, but anything in the attribute set packages will be available in path)

You want to search a package: https://search.nixos.org/packages (or use the cli)

you want to test a package before adding it? nix-shell -p or nix shell for example.

Heck, even if you want it more easy, you could write a tool in less than 100 lines that adds packages names to .json/.yaml/.toml, which allows you to parse it using the nix language and a simple cli written with bash functions to add/remove packages if you wanted.

That's why it is hard for me to understand this project as a product, it seems like a wrapper to the most basic things :\


Respectfully, I'd like to nominate "Heck, even if you want it more easy, you could write a tool in less than 100 lines that adds packages names to .json/.yaml/.toml, which allows you to parse it using the nix language and a simple cli written with bash functions to add/remove packages if you wanted." as the next "why would you need dropbox" comment ( https://news.ycombinator.com/item?id=9224 ).


I once needed to install a specific version of a package on my nix environment. It took me 2 hours to find how...

After a few months, I needed to do that again, but now the project supported devenv.sh. It took me 5 min.

That experience also repeated for other kinds of tasks, for example: start postgres (or redis or elasticsearch or cassandra...), install packages only if the host system is `darwin`, install old versions of packages that aren't on the registry anymore, etc...


How does devenv help with using an specific version of a package in an easier way than nix (with flakes)? Does it have any kind of simpler syntax for overlays? Or you are referring to pinning a nixpkgs version?

I'm not really against tools that make it easier to use nix, I think devenv is a nice tool and I like that it doesn't hide nix, the same way I love home-manager and use it all the time.


> I like that it doesn't hide nix

Yep. That's my main argument for it against devbox.

> Does it have any kind of simpler syntax for overlays?

Yes, it does. But what helps isn't that, but the concise docs with just the information I need to know to get up and running quickly: https://devenv.sh/getting-started/

I've read multiple docs/books on Nix, but I always find myself lost when I need to accomplish anything simple. With devenv, I can spot most of my answers from the docs menu. They are all a single click distant from me.


I tried NixOS because I needed to recreate an environment with a specific GCC version. It was absolute hell, you are likely looking back on your experience with rose colored glasses now that you know how things work. Even really really really basic shit was insane, here's an example: the whole system is built on hashes, and there is no consistent format for them! I was getting an error with hash A even though I explicitly requested hash B, and I couldn't figure out why. Turns out nix can't decide whether to use base32 or base64....

I also tried passing arguments to specify the GCC version in like 10 different ways, *that all failed silently*. Staying far far far away from Nix even though on paper I should love it.

Edit: oh yeah and `nix shell` and `nix-shell` both exist and don't do the same thing


I understand that Nix solves many problems and indeed bet on its ability to do so. It is why I've put so much effort into Nix itself.

However, Nix poses a relatively steep learning curve being built up from first principles making it very general. Flox aims at simplifying this by narrowing the problem field and providing specialized abstractions and interfaces for those who want to benefit from nix' capabilities without needing to becoming a nix expert at day 0.

(flox employee)


Selling coworkers on flox or devenv is way easier than Nix.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: