Live data from Hacker News

My First Impressions of Nix

mtlynch.io

251–260 of 354 posts

Re: My First Impressions of Nix

#251
> With Nix, changes are atomic. Nix either gets your system into the desired state or it rolls back to the state before you tried changing the configuration.

Except the "activation script" is an imperative sequence of steps which can fail or hang. Atomicity really exists only if you `nixos-rebuild boot && systemctl reboot`, and there rollback means picking the previous entry from the boot menu.

Re: My First Impressions of Nix

#252

Earlier quoted context omitted.

I think the thrust of the parent comment was more that the test coverage of this package isn't good, not that semver must be followed.

Ah, fair enough, I misunderstood. I thought the tests they were recommending were tests to ensure backwards-compatibility between version bumps, I didn't realize they were talking about the downstream pacakge's tests. I still disagree with the insinuation that it's everyone else who's screwing up and if we all did things the way Nix wants us to then Nix would actually work just fine. That's just another way of saying…

You're totally right. If you're a package maintainer and you find out some package is misbehaving even though all if its included tests pass, it might kinda make you feel like kicking the thing and calling it junk.

But we should recognize that some of what drives that is just defensiveness, and some is personal frustration. At the end of the day, Nix and Nixpkgs are for letting people run useful software more or less as it exists. It's not just for users or developers of perfectly tested, bug-free software. (Nix itself is certainly neither of those things, and neither is Nixpkgs!)

Re: My First Impressions of Nix

#253

Earlier quoted context omitted.

I'm curious if you have any pointers for whole Mac config with nix-darwin. This is something I've just started looking at and at the moment don't have much more than a nix-shell with some nice-to-haves. Any tips / tricks / guides are greatly appreciated.

Life’s short. Don’t waste it configuring nix-darwin.

Upfront payment figuring out Nix is amortized, and is less than a lifetime of payments of dealing with flakey machines, assuming you have a decent amount of lifespan left.

Re: My First Impressions of Nix

#254

Earlier quoted context omitted.

[flagged]

You're missing something important here. Is Nix harder to learn for somebody who knows nothing about computers and OSes? Probably not. It might even be easier. But that's not Nix's primary audience. It's targeted at people who already know a fair bit about the current paradigm and have plenty of skill with it. For those people, it's very different. Things that are easy for them will be hard until they learn the new p…

I think the parent was focusing on the first point about the install. That particular argument against creating users and writing to directories would be a barrier to install any software.

Re: My First Impressions of Nix

#255

Earlier quoted context omitted.

I think the thrust of the parent comment was more that the test coverage of this package isn't good, not that semver must be followed.

Ah, fair enough, I misunderstood. I thought the tests they were recommending were tests to ensure backwards-compatibility between version bumps, I didn't realize they were talking about the downstream pacakge's tests. I still disagree with the insinuation that it's everyone else who's screwing up and if we all did things the way Nix wants us to then Nix would actually work just fine. That's just another way of saying…

Yep, I agree that the tone was bad.

It is unfortunate that some in the nix community come off that way, because I would say that in general Nix goes to great lengths to adapt to the world as it is. Especially compared to, say, Bazel.

I myself have been using nix in an org that is blissfully unaware of nix for about 2 years, if that's any indication of how adaptable it can be.

Re: My First Impressions of Nix

#256

The problem Nix wants to solve is a valid one. But there are better alternatives imo, such as the newer distros based on rpm-ostree. You can do atomic upgrades, and easily rollback to a previous known good state if needed. No changes are allowed to a live system. And best of all, it's practically the same in terms of management, there's hardly any learning curve.

Sounds interesting. Is rpm-ostree config declarative? Can it install multiple versions of packages and libs simultaneously? Are adding custom packages to your setup a matter of a few lines of additional config, or must you learn RPM? Can you manage home directory config as well?

Re: My First Impressions of Nix

#257
post #61

Earlier quoted context omitted.

No, that is not a fair summary; Nix is the nicest way to manage Python packages that I have found thus far.

I'm assuming you try to keep all dependencies on the nixpkgs version?

That's not really necessary. Pulling in arbitrary versions of packages from PyPi is fairly easy, if a bit verbose.

Re: My First Impressions of Nix

#258
post #136

Earlier quoted context omitted.

Most of the above. - Nix is a tool for building and installing software. - Nix is a language for expressing how to build a package. Nix-the-tool reads expressions defined in Nix-the-language to know what to do. At the end of the day, this translates into normal commands that run in a sandboxed build environment. - Nixpkgs is a monolithic repository of 80000+ packages, defined literally as one giant expression in the…

So does this allow for different boot setups for NixOS? Say “webserver” or “office management” , “media streamer” profiles?

I'm not exactly sure what you mean. NixOS doesn't have, like, a profile switcher to let you switch between work mode and play mode on the same PC. At least not out of the box.

But if you mean distinct computers, then that's just three distinct configs. And it's easy to factor out common bits and use it in all three configs, since you configure things using Nix-the-language.

And if you mean all three at the same time on one PC, that's exactly what I do with my home server.

Re: My First Impressions of Nix

#259
post #239

Earlier quoted context omitted.

(fleek author here) Fleek is a simplified wrapper around Nix Home-Manager, which is used to install and configure the apps that make up your $HOME and shell environment.

This is what I love about Hacker News: post about a random tool I found, and the author shows up! :-) I came across your blog (and from that, Fleek) as I'm rebuilding my home WSL setup, and I just want a simple way to destroy and rebuild my distros and move my installed apps easily. Would Fleek be a good use-case for this?

very much so, that's how I use it. Especially if you want your dotfiles/configs to come with it.

Re: My First Impressions of Nix

#260
post #179

Earlier quoted context omitted.

Nix is a distro that admits defeat against dependency management and entirely gives up on the idea of having system libraries. Instead every application you want to run has to have all of it's dependencies explicitly stated and provided custom in nix style configs for each program. Usually this means someone else has done all this packaging work for you. They hate it when people call it containerization but it's effe…

Well, sure, but setting up the build environment is pretty easy! You just specify the libraries as you normally would, and it works. The only difference is that those libraries are only available to that package, and not globally. The function `stdenv.mkDerivation` will actually build a standard ./configure && make style C project for you if you provide it some package source, you just have to copy out the build arti…

This is the opposite of "pretty easy". (Apologies if I'm just failing to detect sarcasm.)
Post reply on HN