Live data from Hacker News

Nix is the ultimate DevOps toolkit

tech.channable.com

171–180 of 243 posts

Re: Nix is the ultimate DevOps toolkit

#171

Earlier quoted context omitted.

Do you truly understand how it works though? I was similar. I loved my setup and it did mostly just "work" but I found it unnerving that eventually when it does break, I wouldn't know how to fix it.

What kind of breaks were you having that you couldn't simply roll back? Database upgrades, or something?

Can't upgrade Deno from 1.3.3 to 1.8.3 by updating the sources and hashes in the derivation, as is normal procedure. `fetchFromGitHub` and friends fail to recursively fetch commits that are not visible from `HEAD` (`git clone` works), and I'm completely at a loss about how to debug this.

This kind of breaks. For people like myself who already spend a lot of time debugging dependency and compatibility issues in less sound package ecosystems (scripting languages I'm looking at you), Nix alternates between enlightening and maddening. Which I like.

Re: Nix is the ultimate DevOps toolkit

#172
post #164

Earlier quoted context omitted.

If you try to make a Go package, for example, you end up having to provide a hash. To generate the hash `vendorSha256`, you have to run `nix-prefetch`, but that program is broken on MacOS. You can also stub the hash (e.g. with lib.fakeSha256 ). nix-build will fail with a hash mismatch and tell you the correct hash. I mentioned elsewhere that I spent a weekend working with the Nix discord to try to install VS Code wit…

> You can also stub the hash (e.g. with lib.fakeSha256). nix-build will fail with a hash mismatch and tell you the correct hash. Are you kidding me?

Oh, shades of my favorite bug ever, doing commercial product QA two decades ago.

The product had an external license file you'd need to drop alongside, and on boot if your licence key didn't match for your name + connection settings, the retail build would spit out both the key in the file, and the expected correct key for your settings.

It was not a priority fix for them, either. At least this one is merely informational, and not a potential gate on revenue.

Re: Nix is the ultimate DevOps toolkit

#173
To truly appreciate what nix provides, take a look at this example script that uses nix-shell as interpreter and marvel at the fact that running it is as simple as running a binary after you have nix installed.

```

#!/usr/bin/env nix-shell

#!nix-shell -p "(pkgs.haskellPackages.ghcWithPackages (ps: [ ps.text ]))"

#!nix-shell -i runghc

{-# LANGUAGE OverloadedStrings #-}

import Data.Text.IO

main :: IO () main = Data.Text.IO.putStrLn "Hello, World!"

```

While nix is sometimes hard to learn, it is often a much simpler solution and it works for all languages so learning it is well worth it.

Re: Nix is the ultimate DevOps toolkit

#174
post #95

Earlier quoted context omitted.

Now, don't get me wrong, I don't have a horse in this race. But as a complete outsider, this doesn't fill me with confidence. If Wikipedia is to be believed, NixOS was launched in 2003, so 18 (!) years ago, I assume that's when Nix was created. The issue mentioned seems quite basic and you're replying that it will be fixed in a new Nix CLI. This seems like a basic QA fail, I wouldn't want anything like this within 10…

I agree with your reasoning and the reason this is hard to change is similar to Python 2->3 transition. If it was about 50 users, we could just do it. Since there are many users, it takes a while to move from one UI to another.

Understandable. Good luck with the transition!

Re: Nix is the ultimate DevOps toolkit

#175
post #152
post #144

Earlier quoted context omitted.

I think https://nix.dev is what you are looking for. It's a really great resource (and no need to go all in and do _everything_ in nix)

This is orders of magnitude more useful than the official docs.

The unofficial wiki is also very helpful: https://nixos.wiki/

Re: Nix is the ultimate DevOps toolkit

#176
Nothing should be labeled as the ultimate devops toolkit when its documentation is as atrocious as nix

People can commend it as much as they want, but the steep learning curve is largely self inflicted because of their resistance to writing clean, comprehensive, up to date docs

It has also led to the community being filled with a lot of arrogance and pretentiousness

I wouldn't run nix in production because of the lack of accessibility and toxic community. There are other ways to get reproducibility, etc without using an arcane and poorly documented toolkit

Re: Nix is the ultimate DevOps toolkit

#177
post #105

Earlier quoted context omitted.

I still don't understand the language syntax after using it for several years, I just make it work through trial an error. The documentation is pretty unhelpful too. It's ultra ambiguous. Recently my laptop died, and I just needed another one going in a hurry and I tried Xubuntu because it's the only distribution which had Wifi drivers that worked for a 12 year old Mac I had lying around without any trickery. It's fu…

I switched to NixOS after tripping over my laptop's power chord during an update, which broke Linux in such horrifying ways that I didn't dare attempt recovery. I agree that I'm not sure the extra complexity is worth it for day to day use, but just the ability to avoid catastrophic failure and near instant setup on new machines is worth it I think.

Or you could, you know, use any kind of backup/restore software, spend like 5 minutes to learn how to use it, and use those many hours invested in learning Nix to watch football and drink beer :-)

Re: Nix is the ultimate DevOps toolkit

#178
post #59
post #51

I tried Nix a few days ago. I set it up on an existing Arch install. I installed a couple of packages with "nix-env -i [package] and then tried to update them with "nix-env -u" as instructed in the official documentation: https://nixos.org/manual/nix/stable/#ch-basic-package-mgmt This ended up breaking the entire install. After a few hours of troubleshooting I found that the reason it broke was that it updated itself…

I wish Nix would just get rid of nix-env. It's not the way it's meant to be used, you should be using "nix run" or nix-shell for temporary usage, and home-manager for dotfiles and user dependencies. Using Nix like an imperative package manager is not really an improvement over existing ones, the declarative bit is where it truly shines.

at least now, people get recommend to use `nix-shell -p ` when something is missing in NixOS

Re: Nix is the ultimate DevOps toolkit

#179
post #59

Earlier quoted context omitted.

I wish Nix would just get rid of nix-env. It's not the way it's meant to be used, you should be using "nix run" or nix-shell for temporary usage, and home-manager for dotfiles and user dependencies. Using Nix like an imperative package manager is not really an improvement over existing ones, the declarative bit is where it truly shines.

Eh, I don't think nix-env is all that bad. Put it this way: nix-shell lets you dip your toes in the water, without learning the Nix language. Amazing value added... but sometimes it's annoying that it forgets that package you used yesterday. nix-env lets you "install" software, without learning the Nix language. Great, now I can use that Nix package repeatedly without having to nix-shell it. We're still better off th…

The issue with `nix-env` is how it tries to decide a later version. Python also has this issue, because it will see that python3.7 has a newer version called `python3.10a3`, and installs the alpha/dev version, instead of the expected python3.7.x

Honestly, if people just used nix for `shell.nix` in projects, it's still major value added

Re: Nix is the ultimate DevOps toolkit

#180
post #59

Earlier quoted context omitted.

I wish Nix would just get rid of nix-env. It's not the way it's meant to be used, you should be using "nix run" or nix-shell for temporary usage, and home-manager for dotfiles and user dependencies. Using Nix like an imperative package manager is not really an improvement over existing ones, the declarative bit is where it truly shines.

As somebody who wants to try out nix, but has almost no knowledge of it, I would like to find resources that show the "right" way, or perhaps the "best" way to use nix. Do you know of existing documentation that explains that, according to your opinion?

I made a few videos, https://www.youtube.com/channel/UC-cY3DcYladGdFQWIKL90SQ . However, I need to produce more and of higher quality.
Post reply on HN