Live data from Hacker News

NixOS: Declarative Builds and Deployments

nixos.org

1–10 of 83 posts

Re: NixOS: Declarative Builds and Deployments

#3

Honestly, I don’t really understand the advantages (or the point of) NixOS over something like Docker.

Docker is not reproducible, you just apt-get install what you want hoping that the RUN commands get you a version that is still compatible with your software and doesn't break anything. With NixOS, you can pin the specific hash of every software, and you don't need the entire Ubuntu 20.04 in a container to deploy a webapp.

Re: NixOS: Declarative Builds and Deployments

#4

Honestly, I don’t really understand the advantages (or the point of) NixOS over something like Docker.

You can build containers with nix, but they’re completely different. One is an operating system built around a package manager and the other is a containerization tool.

More appropriate comparisons would be: - NixOS and Ubuntu - nix and apt/homebrew

Re: NixOS: Declarative Builds and Deployments

#5
I have had a great experience using the Nix package manager on other Linux distros. It's super easy to try out software with `nix-shell -p somepackage`. (It's a little rockier on macOS.)

Another neat trick is reproducible shell scripts that use Nix to declare their dependencies in a sort of extended shebang line.

Re: NixOS: Declarative Builds and Deployments

#6
I like the idea of nixos. Having one file responsible for all packages installed on the system is way better than what traditional distro use. I just don't like the quality of the packages. It would be nice if someone could do something like a os wide packages.json but for a mature packages repository like Debian.

Re: NixOS: Declarative Builds and Deployments

#7

Honestly, I don’t really understand the advantages (or the point of) NixOS over something like Docker.

Better composability and abstraction, see for example how you can configure a process in https://devenv.sh/services/ that has first-class support for development environments using Nix.

No need to use containers too, which bring cognitive/workflow overhead.

Re: NixOS: Declarative Builds and Deployments

#8

Honestly, I don’t really understand the advantages (or the point of) NixOS over something like Docker.

NixOS is also a declarative build of the entire machine as opposed to just a container also, so it's totally normal to have a NixOS build with multimedia apps, games, etc. To me, Docker is for building an entire environment for a single app to run in, whereas NixOS is for building an environment that runs multiple apps. Like a microservice vs a desktop machine.

Re: NixOS: Declarative Builds and Deployments

#9
post #6

I like the idea of nixos. Having one file responsible for all packages installed on the system is way better than what traditional distro use. I just don't like the quality of the packages. It would be nice if someone could do something like a os wide packages.json but for a mature packages repository like Debian.

Which package did you have issues with?

Re: NixOS: Declarative Builds and Deployments

#10
I first looked at nix-shell which you can use to create ephemeral environments just like Docker, with the difference that they are 100% reproducible and you don't need containerd or like. It is awesome to create scripts which run the same on EVERY system.

Then looked at NixOS. I geht the point of having a deklarative like OS which you can rebuild in a couple of minutes, BUT the nix language is kind of unituitive and all the tools like flake and nix packages do some magic it con't quiet understand. It does not help that the docs are kind of meh.

Post reply on HN