Live data from Hacker News

Devenv.sh: Fast and reproducible developer environments using Nix

devenv.sh

1–10 of 171 posts

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

#3
This looks nice! I’m really enthusiastic about these nix based dev env systems. Recently saw devbox[0] here, tried it out and fell in love. It’s made me very interested in all things Nix!

0 - https://news.ycombinator.com/item?id=32600821

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

#5
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.

If I’m not mistaken, Nix uses cgroups as well on non-NixOS systems, so it is basically containers. You’re probably thinking about docker as a whole, in which Nix is effectively an alternative package manager/distribution system for containers.

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

#7
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.

If I’m not mistaken, Nix uses cgroups as well on non-NixOS systems, so it is basically containers. You’re probably thinking about docker as a whole, in which Nix is effectively an alternative package manager/distribution system for containers.

I believe you are mistaken; Nix has no intrinsic connection to cgroups / containers.

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

#8
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.

One thing is perfect caching. Each package is cached in its own folder, so if you exchange one package you don't have to rebuild the rest of the image.

Also you can have multiple versions of the package cached.

Also all your environments benefit from the cache, since each "layer" is independent.

Docker's layer based caching is very limiting for larger images. With Nix you spend basically no time on incremental builds outside of the time for the one package you changed.

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

#9
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.

Though it’s like comparing apples and oranges, the primary advantage over containers would be performance.

Nix (not to be confused with NixOS) is a package manager. Think of it like apt.

Containers on the other hand are (usually) utilizing kernel level isolation to run a whole user space starting with PID 1. These isolation techniques have overhead.

Since Nix is a user space application, you can run it in a container and Nix provides one `nixos/nix`.

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

#10
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.

If I’m not mistaken, Nix uses cgroups as well on non-NixOS systems, so it is basically containers. You’re probably thinking about docker as a whole, in which Nix is effectively an alternative package manager/distribution system for containers.

It uses some of that stuff to isolate its background build sandbox, but none of it affects a normal nix subshell.
Post reply on HN