Live data from Hacker News

Why I love NixOS

birkey.co

221–230 of 323 posts

Re: Why I love NixOS

#221
post #55

I switched over to Nix about a year ago. I was a Windows user before that for 30 years and tried Linux a couple of times, but it never stuck. Now I know I will never touch Windows again. With NixOS I've finally found a system that actually works for me — and the full OS configuration is in a repo. My god, I love it so much. Sometimes I even prefer nix-shells over uv for quick one-off Python scripts. I cannot sufficie…

Can you share some good examples of how you use nix shells with python for one off scripts? I am still figuring out how python interacts with nixos :(

Not the greatest fan of python, but when I've got to run a python script, I do `nix-shell -p 'python3.withPackages (ps: [ps.requests])' --command 'python3 your-script.py'` Note that there is one argument to -p and one argument to --command -- both are quoted. The argument to -p is a nix expression that will provide a python3 command, referring to a python3 with the requests package. The argument to --command is a bash script that will run python3 with the argument "your-script.py" i.e. it will run your-script.py with the python3 that has the requests package.

I think there's ways you can autoderive a python3 with specific packages from python dependency files, but I can't help you there. I do find AI to be reasonably helpful for answering questions like this: it just might sometimes require a bit of help that you want to understand the answer rather than receive a perfect packaged shell.nix file.

Re: Why I love NixOS

#222

Most people who try Nix either quit in the first week or never go back to anything else. There is no in between.

There is. Give it a go every few years and decide either Nix is not ready or I am not ready for it.

Re: Why I love NixOS

#223
post #204

Earlier quoted context omitted.

I indeed searched for the longest chain. Something that happens in 4.5k lines twice is hardly rare. And even if you take away a brace it occurs even more frequently. And yes your example is better, but still terrible. The point is not the formatting. The point is that there is that 10 deep nested code is just not easy to understand. I would also say a line of c/python that does 10 nested function calls as unreadable.…

> Something that happens in 4.5k lines twice is hardly rare. Provided you don't consider the context, sure. One of them is software with buggy tests, the other is one that provides a custom test suite that basically has to be reimplemented in the package definition. How often do you think either of those things happen?

Looking at a lot of nix package expression: Quite a bit. Besides, just taking a way a single brace gives 7 hits. Still a ridiculous level of nesting. So I don't go with your reasoning that these are some kind of super special cases. If something happens so often in 4500 lines of code you cease the right to claim it is special.

Re: Why I love NixOS

#224

The author almost touches on the one more topic that I adore about Nix, but ends up just so missing it: NixOS is absolutely incredible for its ability to be configured through AI tooling. And I don't mean that it's better than other operating systems, I mean that it's the only game in town. I've been using Nix, both the package manager and the operating system, for years by now. I agree with all of the author's point…

Same, I've been playing with kernel settings for AMD, and it's really easy to revert in case things blow up

Re: Why I love NixOS

#225

i've been tempted by NixOS for servers but keep going back to Debian. the reproducibility is amazing in theory, but when you need to debug a DKMS kernel module build at 2am on a VPS, having "just apt install" is worth a lot. maybe NixOS for dev workstations, Debian for production VPS is the right split.

The reproducibility is amazing in reality: you either just run the misbehaving server’s config in a VM (one command) or spin up a throwaway VPS and apply the config to that (one command and about 60s). One of the major benefits of reproducibility is not having to poke at production machines because that’s the one place you can manifest the issue, now you can reproduce the in-production issues in a safe environment and fix them there.

Re: Why I love NixOS

#226
post #99

Earlier quoted context omitted.

Ok, but I guess a more concrete version of my question is the following: > How do I set up my development environment using devenv.sh to pin nodejs to 24.14.0? If I understand your response correctly, I can't do this in any very practical way.

Generally something like languages.javascript.enable = true languages.javascript.package = pkgs.nodejs_24

24 != 24.14.0

Re: Why I love NixOS

#227

Earlier quoted context omitted.

For a personal desktop environment, I just install them normally when there's no up to date nixified option. For some things I've vibe-coded a nix module on github that uses a scheduled github action to check for underlying app updates and then it generates a new hash and tags a release. I've done that for claude code and cursor, which is also an opportunity to let me manage their config files from my nix config.

I run NixOS and the number of times ive been able to install something 'normally' (not via nixpkgs/flake) is approximately zero. You cant go to a website and download a binary and just run it. Almost every program references a shared library and wont be able to find it. Nixpkgs is very complete in my experience, and in the instances where its not, someone usually has made a flake. The only times ive had to custom-mak…

> the number of times ive been able to install something 'normally' (not via nixpkgs/flake) is approximately zero. You cant go to a website and download a binary and just run it

You can: https://github.com/nix-community/nix-ld

Re: Why I love NixOS

#228
The versoining and ability roll back is game changing for SRE Agents and preventing their ability to royally take down services, being able to audit and go back to the previous good known state is gold

Re: Why I love NixOS

#229

Earlier quoted context omitted.

I don't agree at all. Just look at these derivations: https://codeberg.org/guix/guix/src/branch/master/gnu/package... I counted and you regularly see this: "))))))))))" at the end. This is not a language that is optimizing for being written by humans.

Lisp programmers have used editors that count the parens for them for decades. Many use something like paredit that simply automatically adds the final paren. I've written significant amounts of Lisp and you simply don't see the parens. You might as well complain about French having all those accents. It's just a different language. Learn it and you'll see why.

I can write lisp. That a lot of lisp programmers require special editors to handle it should tell you enough. It's not that the language is unworkable. You can definitely write stuff in it. The point is that it is quite far from something that should be written by people, in my opinion.

Re: Why I love NixOS

#230
post #108

I've recently switched to nix as a way to encode my environment across my server and work / private devices a bit more than just having some Brewfiles. I know it's not worth it for the computer switch every few years but having a somewhat opinionated place to centralize my config is worth it over regular dot files. My first impression after a week of using: - I really dislike the complexity of terraform, and this is…

Add `nix-darwin` to your path (it probably already is on it) and run it while in the directory of the flake: "nix-darwin switch --flake .#private"
Post reply on HN