Live data from Hacker News

Devenv.sh: Fast and reproducible developer environments using Nix

devenv.sh

71–80 of 171 posts

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#71
Another project I've been following in this space (no affiliation) is Tangram (https://www.tangram.dev/), which I think of as "Nix, but TypeScript" -- or, from their Discord:

> Tangram takes a lot of inspiration from nix, and could be described as a mix between nix and bazel where you write JS/TS

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#72
post #62

this, devbox, and others seem to be alternatives to `nix-env shell` or the flake-based `nix develop`. spurred i think by a desire for better UX. these are excellent for any project off-the-ground enough that you’ve run `git init` or created a repo. the adjacent area i’m struggling with is the “i want to write a tiny program to verify some conjecture, and i’ll probably throw it away an hour from now”. think codegolf c…

asdf was the closest to this, but the startup time is pretty bad (there is a 300ms+ delay) for apps. It is a giant hack but works well. But I hear about weird dependency issues all the time with Macs (both Intel and the newer Apple Silicon) with Erlang or Elixir. I'm really excited for nix as true sandboxing would be great. Nix however I couldn't get working properly.. and I've been using Linux for almost 17 years. O…

> but the startup time is pretty bad (there is a 300ms+ delay) for apps.

Someone has told me that this can be solved with asdf-direnv so I am wondering if this is true and I should actually consider using asdf.

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#73
post #2

Can someone explain to me the advantage of using Nix over containers? What do they offer that are not provided with using docker or other container platform.

Nix is good at solving more problems than containers can solve. Nix is good at "programmatically managing packages".

For just the problem of "I want to be able to distribute the same application everywhere", container images solve this well. This can also be solved using Nix instead of container images; or Nix can even be used to build the container images.

The Nix expression language is much more expressive/powerful/elegant than Dockerfile's syntax is. -- Which can be useful for stuff like declaring "I want built with different build flags / patches".

Nix ends up being useful for scratching the itch of "put in effort now, to save effort later".

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#74
post #57

Earlier quoted context omitted.

Don't know why it is downvoted but isn't it a legitimate concern that if dev and prod environments are produced differently with different tool chains, it might result in discrepancies? Concrete example, dev environment with nix but production is Dockerfile with apt getting packages? Thoughts?

That question never stopped developers from getting Apple hardware and OSX at their workplaces and it seems they've been productive, even though hardly anyone except mobile developers deploy anything on OSX. Besides, what's the point of having a production environment based on apt if it can be derived from the same graph of all dependencies that you use for building and running your software locally by Nix? [1] There…

Sure, but if you develop C++ code on mac, you cannot debug locally using the same compiler that you will deploy upon. Maybe JVM , node etc for purely UI programming may work on Mac because they have support for it, but why depend on the tool writer (JVM, Node) to work on mac when we are developing an OS specially for development?

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#75

Another project I've been following in this space (no affiliation) is Tangram ( https://www.tangram.dev/ ), which I think of as "Nix, but TypeScript" -- or, from their Discord: > Tangram takes a lot of inspiration from nix, and could be described as a mix between nix and bazel where you write JS/TS

Looks like there is no source available or even installation option?

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#76
post #63
post #44

Earlier quoted context omitted.

Do you use NixOS? I've found it a little too clunky for my taste, as a Gentoo Linux user. But maybe Nix is still worthwhile for me as a standalone tool.

I used Gentoo for over 15 years before switching to NixOS. I like it so much better, I'm never going back.

How about someone from let's say Ubuntu/Debian or Fedora?

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#77
post #2

Can someone explain to me the advantage of using Nix over containers? What do they offer that are not provided with using docker or other container platform.

Strictly compared to containers, the big advantages are reproducibility and lower overhead. Overhead: Windows and macOS can't run Linux-based containers natively. Instead, there's always a full Linux virtual machine running in the background acting as an intermediary and host for your containers. Nix can conjure arbitrary native development environments on a per-command or per-terminal basis, giving you all the perfo…

Would nix guarantee that all upstreams are available forever? Is nix planning to replace all upstreams? (PyPI, Conda, npm etc?) OR does it plan to keep a cache forever?

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#78

Hi all, I'm the author of https://devenv.sh , https://cachix.org and https://nix.dev . I've been part of the Nix community for more than 10 years and in the last 4 years focused on making it documented, simple and accessible for any developer. After building Cachix (where you can store any software binaries with a few steps) we realized that there needs to be an intuitive interface for crafting developer environments…

The nix language basics section of nix.dev finally got me to understand what is actually going on in a derivation file and in my default.nix, so thank you!

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#79

Earlier quoted context omitted.

Strictly compared to containers, the big advantages are reproducibility and lower overhead. Overhead: Windows and macOS can't run Linux-based containers natively. Instead, there's always a full Linux virtual machine running in the background acting as an intermediary and host for your containers. Nix can conjure arbitrary native development environments on a per-command or per-terminal basis, giving you all the perfo…

Would nix guarantee that all upstreams are available forever? Is nix planning to replace all upstreams? (PyPI, Conda, npm etc?) OR does it plan to keep a cache forever?

Nix doesn't keep a cache of the upstreams, though there are some projects planning to try to do that I think.

The build recipes pull from the original source and use a hash to ensure that the source artifacts don't change. Nix caching is usually done at the build output layer, e.g. the resulting binaries.

Re: Devenv.sh: Fast and reproducible developer environments using Nix

#80
post #2

Can someone explain to me the advantage of using Nix over containers? What do they offer that are not provided with using docker or other container platform.

Strictly compared to containers, the big advantages are reproducibility and lower overhead. Overhead: Windows and macOS can't run Linux-based containers natively. Instead, there's always a full Linux virtual machine running in the background acting as an intermediary and host for your containers. Nix can conjure arbitrary native development environments on a per-command or per-terminal basis, giving you all the perfo…

AFAIK, Nix does not work natively on Windows (you need to go through WSL), so it's not better in that regard.
Post reply on HN