Live data from Hacker News

Will Nix Overtake Docker?

blog.replit.com

131–140 of 259 posts

Re: Will Nix Overtake Docker?

#131

I used Docker Compose to, among other things, manage Postgres, which wants to listen to port 5432 and use a central dir to hold databases. Can a non Docker solution allow me to run multiple instances of Postgres?

Deploy them into different directories and have them listen on different ports. You can configure the deployment directory when building from source and then set the port numbers in the respective “postgresql.conf” files.

Re: Will Nix Overtake Docker?

#132
For containers? No way, Dockerfiles are much simpler than nix configuration.

For workstations? ostree is the future, not nix, IMO. Check out Silverblue. Flatpak takes care of the desktop aspect.

NixOS is an interesting attempt at solving the reproducibility problem, but it hasn't been adopted because it's just a stepping stone towards a better solution. It has far too many quirks to hit mainstream, it's too complex, under documented and it's still based upon package management, which is getting obsolete as the Linux world is moving fast towards containerising everything.

Re: Will Nix Overtake Docker?

#133

I tried using Nix and NixOS early in the year, but documentation is an issue. Also, while I appreciate NixOS’s focus on reproducible configuration, I also have 25 years worth of mediocre Unix sysadmin experience, and it would be nice if the system found a way to accommodate Unix. My last straw was trying to get nix to schedule some task through systemd, when what I wanted was a simple crontab.

NixOS includes a cron daemon (Vixie cron), and you can add crontab entries directly either as strings or as files: https://search.nixos.org/options?channel=21.05&show=services...

You can use, e.g.,

  services.cron.enable = true;
  services.cron.systemCronJobs = [ ''
    */30 * * * * someuser bash /path/to/some/script/idk.sh
  '' ];
or if you really don't want to worry about the Nix syntax for a list of strings, and possible escaping issues, you can just create a crontab file in /etc/nixos next to configuration.nix and write

  services.cron.cronFiles = [
    ./crontab
  ];

Re: Will Nix Overtake Docker?

#134
post #29

Oh god I hope not. Having worked in > 100kloc nix environments I am completely turned off of the idea. I really really tried, I installed NixOS as my main OS and used Nix whenever I could to try and pick it up, but it's such a complex beast I felt it slowed everything down. Simple tasks that would take 10 minutes in Docker suddenly became DevOps tickets. I suddenly had to write bindings for tools rather than apt-get…

>Build times in Haskell were bad enough this one's very true. Every time I try to build something in Haskell on my laptop it feels like we're moving closer to the heat death of the universe. Is there some good read on how/why Haskell compilation times are so long compared to some other languages?

I can't offer an answer specific to Haskell, but I know that OCaml does some things to make the compilation fast: interface files, no circular dependencies, no forward declarations, not a lot of optimizations. From what I understand, those tradeoffs come from languages designed by Niklaus Wirth, where efficiency of compilation was important.

In general, I feel like every language that wasn't made to compile fast like Go, OCaml, Pascal and derivatives is going to be called "slow to compile". There's Java and C# that are kind of a middle-ground, since they emit bytecode for a JIT compiler. So my answer to "why Haskell compilation times are so long compared to some other languages?" would be "because compilation times don't take priority over some other points for Haskell and its users".

Re: Will Nix Overtake Docker?

#135

Earlier quoted context omitted.

>Build times in Haskell were bad enough this one's very true. Every time I try to build something in Haskell on my laptop it feels like we're moving closer to the heat death of the universe. Is there some good read on how/why Haskell compilation times are so long compared to some other languages?

> moving closer to the heat death of the universe So… you're saying your laptop is super cool? Because the heat death of the universe is when thermodynamic energy is equally distributed everywhere, which, given the large space of the universe, means really cold.

[deleted]

Re: Will Nix Overtake Docker?

#136
post #29

Oh god I hope not. Having worked in > 100kloc nix environments I am completely turned off of the idea. I really really tried, I installed NixOS as my main OS and used Nix whenever I could to try and pick it up, but it's such a complex beast I felt it slowed everything down. Simple tasks that would take 10 minutes in Docker suddenly became DevOps tickets. I suddenly had to write bindings for tools rather than apt-get…

> There's a blog post that goes around from time to time about how a company have three risk tokens to allocate per project on non-boring technologies. https://mcfunley.com/choose-boring-technology

I wish I had seen that (and fully understood the implications) years ago, I mean it's been in the back of my head all the time but never explained this well. I've referenced it a couple of times now, especially the slides showing the graphs of technologies and links which is a really succinct way of saying "adding one technology multiplies complexity".

Re: Will Nix Overtake Docker?

#137
post #48

As someone who has never used Nix, from first glance the question I ask myself is... why?

Nix

  - is fast (faster than Homebrew or Docker)
  - is multi-user (don't need root privileges to install software)
  - lets you try software without permanently installing it
  - gives you fast, reliable undo without requiring a special filesystem
  - lets you automatically (re)produce a setup that never drifts from its official definition
  - can safely perform upgrades and configuration changes without thinking about what has been done to the system or environment in the past
  - has tons and tons of software already packaged for it at this point, which you can just use without any special effort

Re: Will Nix Overtake Docker?

#138

Earlier quoted context omitted.

>Build times in Haskell were bad enough this one's very true. Every time I try to build something in Haskell on my laptop it feels like we're moving closer to the heat death of the universe. Is there some good read on how/why Haskell compilation times are so long compared to some other languages?

> moving closer to the heat death of the universe So… you're saying your laptop is super cool? Because the heat death of the universe is when thermodynamic energy is equally distributed everywhere, which, given the large space of the universe, means really cold.

Heh. Though while we're playing Pedantics, it's worth pointing out that the defining characteristic of Heat Death is maximum entropy, not uniform temperature. That said, it's entirely possible that the whole system of Energy Company + OP's computer actually does get cooler on average when compiling Haskell.

Here's a fun game. Have you ever played Follow the Energy? For example, depressing keys on your keyboard takes energy. Where does that energy come from? Well, the work performed by your fingers of course! But where does that energy come from? Well, the muscles in your fingers, of course! But where does that come from? Well, your food! But what about that? Well, your food's food! That? Eventually plants. That? The sun! That? Nuclear fusion. That? Gravitational potential! That? Etc...

But here's the funny thing. In this image, it kind of seems like energy gets "used up". The sun provides energy to the earth via solar radiation; the plants consume this energy; animals eat the plants, obtaining their energy; etc. However, energy is conserved. What gives?

Better yet, if the earth were not radiating just as much energy as it received, it should be heating up. However, the earth-atmosphere system is mostly constant temperature! This implies that the total energy flux is zero. If X Watts (Energy/Time) is coming in, then the earth actually radiates out X Watts as well.

So... if the total energy flux is zero, then how does your keyboard key actually get pressed? What gives?

The key is entropy. X Watts of solar radiation impinge upon the earth, but these photons are "hotter" (i.e. higher frequency) on average than those that radiate out. The balance is in numbers. You need more cooler photons to balance the energy of the hotter ones. E=hf; energy (E) is proportional (constant h) to frequency (f), after all.

This means that while energy is conserved, the flow of that energy increases the entropy of the system. In a very real sense, typing on your keyboard happens because of the waste heat generated in the process.

All driving us closer to Heat Death...

Re: Will Nix Overtake Docker?

#139
post #132

For containers? No way, Dockerfiles are much simpler than nix configuration. For workstations? ostree is the future, not nix, IMO. Check out Silverblue. Flatpak takes care of the desktop aspect. NixOS is an interesting attempt at solving the reproducibility problem, but it hasn't been adopted because it's just a stepping stone towards a better solution. It has far too many quirks to hit mainstream, it's too complex,…

There's a third use case (and possibly more): For developers of a project, where you want to manage some software per-environment, rather than via flatpak. But also want closer integration in the system, not building a new system on a side (like containers).

Re: Will Nix Overtake Docker?

#140
post #132

For containers? No way, Dockerfiles are much simpler than nix configuration. For workstations? ostree is the future, not nix, IMO. Check out Silverblue. Flatpak takes care of the desktop aspect. NixOS is an interesting attempt at solving the reproducibility problem, but it hasn't been adopted because it's just a stepping stone towards a better solution. It has far too many quirks to hit mainstream, it's too complex,…

> it's still based upon package management, which is getting obsolete as the Linux world is moving fast towards containerising everything.

Container images still rely on package management. There's no fully containerized future where everything is just `./configure && make && make install`'d all the way up from Linux From Scratch or whatever.

Fedora Silverblue's ostree image is still managed by dnf and RPM underneath, too.

Post reply on HN