Live data from Hacker News

My First Impressions of Nix

mtlynch.io

191–200 of 354 posts

Re: My First Impressions of Nix

#191

Earlier quoted context omitted.

> Extremely complicated and hard to understand That is absolutely not true. If you start to get the hang of it and follow the way things are supposed to be done then things get easier over time. You need to invest upfront more time into your configuration but on the long run it pays off and saves you from an entire error class. > projects that use it have builds fail anyway The point of Nix/NixOS is not to have no fa…

I've never seen it actually pay off in industry. I've seen it be used as good job security while other devs just wrote docker files and got things done.

If you have something easy to deploy like a go binary you can just write a dockerfile but for big python projects that start to compile dependencies that is quickly no longer true. The dockerfile likely is also not matching the software you run and test on your local machine, so sometimes debugging is not as easy. Ofcourse you can debug inside the container but then you are missing all your tooling and need to bring that with you. And rebuilding a dockerfile is often not reproducible, so if you want the container back from 1 year ago and you no longer have the artifact you are probably out of luck.

With nix you can easily open a shell with the packages used in the docker image or go back in time and reproduce that image from a year ago with the flake.lock from a year ago.

Also applying patches to dependencies used in dockerfiles is not dead easy as with nix.

Re: My First Impressions of Nix

#192
15 minutes to configure a local VM for development with Ansible? That feels very off. It used to take me about that long to set up a Kubernetes cluster on remote VMs from scratch (with etcd, load balancing, etc.). I haven't used it for a while though.

Re: My First Impressions of Nix

#193

Earlier quoted context omitted.

You don't have to manage your system with NixOS to reap the benefits of Nix. It solves very real problems that very much exist, it might not exist if you're a one-man show deploying WordPress to GoDaddy though. Barrier to entry: 1. Run the nix installer 2. Enable flakes 3. cd project 4. nix run This ensures you run the package with every dependency except the kernel pinned to a hashed version. If dependency hell is n…

You're omitting the entire thing about learning how to write nix. Which is nightmare fuel even for FP fans.

Unless you are attempting advanced things you don't need to know a lot about the language and how the more advanced things work.

Re: My First Impressions of Nix

#194

Earlier quoted context omitted.

> Is it fair to summize that python applications with python dependencies do not really work well as nix packages and shouldn't be used? No, applications that are properly maintained work as they should and this can be ensured with tests and e2e tests.

This is such a condescending attitude. What you mean is applications that are maintained the way that you and the Nix developers think an application should be maintained. It's incredibly naive for a package manager as ambitious as Nix to assume semver. I'm a big fan of semver myself, but the vast majority of software projects follow it imperfectly or not at all, and for good reason—it's nearly impossible to follow i…

Nixpkgs does not assume Denver that's why we run if possible the package's tests, our own tests and build dependent packages to make sure the most obvious breakages are noticed before things are even merged.

Re: My First Impressions of Nix

#195

nix: automating running scripts from random readme.md as root. the amount of JavaScript devs just learning SE in this thread defending the maybe-good-enough-for-your-dev-box nix is so amusing. it's like seeing second year CS students thinking they mastered system programming because they wrote one toy compilet that optimizes one loop they were looking at the time. not saying it's bad. it's a very essential first step…

This is a pointless comment, nix is more than robust enough for servers, gaming machines, general purpose desktops and developer machines. If you don't understand the tech don't disparage the users or the tech.

Re: My First Impressions of Nix

#196

Earlier quoted context omitted.

I don't see how NixOS doesn't provide 2. It's extremely easy to apply patches.

Depending on what you are patching, it will invalidate a great part of the cache, and you will be looking at very long build times for everything in your system.

For that reason many modules have options to set the packages used, so that you can eg. patch openssh without rebuilding everyone.

Re: My First Impressions of Nix

#197

Earlier quoted context omitted.

Go with Ansible unless you want to fully dedicate into Nix ecosystem and spend a lot of time learning it (and it's not easy, for example because of lacking documentation). Also Ansible is something you more often find in actual projects/workplace.

well, yes true, but ansible sucks and especially for small and chaotic projects where people just change things on the machines without reflecting it in ansible it is a nightmare

You can hardly blame the tool for that, it's your process that's flawed.

Re: My First Impressions of Nix

#198

Earlier quoted context omitted.

That's confusing because NixOS also seems to be an operating system, looking at the blog post?

NixOS is just a super barebones distro where everything is configured with Nix. You can also use Nix on Ubuntu or some other distro.

Bare bones as in by default you don't get much unless you turn it on

Re: My First Impressions of Nix

#199
post #13

I've occasionally encountered projects using Nix, and I've casually browsed the Nix and NixOS websites, but I still don't have a clear idea of what Nix is. Is it a package manager? A build system? An operating system? A container platform? A sandbox? An automation tool? Which widely used, existing software tools is it analogous to?

"Yes, it is." AFAIK It's each of those things, each unfortunately named the same.

Only the package manager and the language share a name, everything else is named more unique

Re: My First Impressions of Nix

#200

Earlier quoted context omitted.

> Of course we, like all other python projects, don't support using other dependency versions then the ones in the requirements.txt file. That's really bad. You should always support reasonable version ranges. > when someone just uses a different minor version of django, stuff breaks That's why some people say that managing dependencies in Python is difficult and move to statically compiled languages.

> That's why some people say that managing dependencies in Python is difficult and move to statically compiled languages. Yes, completely agreeing with that.

I don't.
Post reply on HN