Live data from Hacker News

Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

zero-to-nix.com

191–200 of 227 posts

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#191
post #121

How fast is nix on delivering security patches? I am looking for arguments to use it in an enterprise setting given the declarative nature but unless there is somebody who will sell you a support contract and Guarantee security updates it seems like a hard sell

It is actually slower than Ubuntu which can be see with the recent git update BUT if you know you need this patch or update it enables you to achieve that with overlays pretty easy and fast and if you know what you are doing you can reduce the rebuild amounts to near zero. You also need to remember that behind NixOS there is not a big corp like canonical but mostly a community with way to much time. If you ever tried to build an Ubuntu package with a custom patch you will know how painful it is and unmaintainable. Not with nix. Easy maintenance included with automatic, atomic rebuilds and applying the patch to the next software version if the source code didn't change.

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#192
post #188

Earlier quoted context omitted.

Funny i don't want a UI, i just want better type systems so some random field is easily known. I know it's difficult, but strictly from a user experience - that's all i want lol.

I'm really optimistic about Nickel, which is a new DSL based on Nix (in terms of inspiration) and designed for Nixpkgs-like use, but informed by the designs of other DSLs in the same space (e.g., Starlark, CUE, JSonnet). One of the things it adds over Nix's design is types (it grew out of early efforts to add gradual typing to Nix). It has a gradual typing system with 'contracts' for dealing with untyped code. I have…

I've been patiently waiting the nickelnixpkgs integration. Several hurdles they have to solve first though, iirc, but yea Nickel looks great.

Really that's almost all of my issues with Nix[(pkgs|os)]. Nickel hopefully solves that quite well.. we just need it to work with Nix first, which is a big hurdle on its own.

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#193
post #123

Earlier quoted context omitted.

How does Nix compare to Environment Modules: https://modules.sourceforge.net/ Am I correct in understanding they are similar, except Nix has the "pure" package building?

This is not Nix, but in showing the Environment Modules support for Guix the blog post also shows how functional package management (as implemented in Nix and Guix) differ: https://hpc.guix.info/blog/2022/05/back-to-the-future-module...

Helpful article and cool feature! Thanks for sharing

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#194

Earlier quoted context omitted.

I love Nix, all of my machines run NixOS, but I think it's 5-10 years out from widespread adoption. Currently the biggest issues have to do with severely lacking documentation, lack of developer tooling (missing things like LSP), very slow iteration cycles, confusing or impossible to understand errors, and even naming (Nix refers to the language, package manager, cli, community, etc). That said, right now it's still…

> (Nix refers to the language, package manager, cli, community, etc) Thats wrong. It refers to exactly two things: the language and the cli that implements that and is a package manager at the same time.

So you're saying that it is not a language, package manager, cli and community, but it is a language, a package manager and a cli (and I guess we can assume that talking about the "Nix community" makes sense).

How was the parent wrong again?

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#195
Two years ago I didn't know a thing about nix, NixOS or functional programming. I wanted to manage multiple machines with a sort of config file. Shouldn't be that hard, right? Removal of packages should be done automatically without explicitly removing the package. So brew and ansible failed already with those, to me at the time, pretty basic requirements. Building deb meta packages was inconvenient and they broke every single time when I didn't update a machine for some weeks. Managing requires, replaces, conflicts was cumbersome and often put me into hard problems. Then I learned about nix. First it seemed rather complex. Why does it need to do everything different? Strongly believing that it won't solve my problems and it isn't worth the rather steep learning curve. I tried two weeks to find alternatives but there where none and slowly nix seemed to be the only available solution to my problem which first didn't seem to be that complicated...

Here I am now. With LOTs of struggle and sweat. Never gave up debugging the most strange errors and very often fixing them in the end. Starting as a total beginner and very slowly becoming a very big fan, advocate and contributor to NixOS. Not regretting the journey. Being happy to have remove all Debian frickel kisten from my life. :)

PS: If you run NixOS 22.05 or older: Some parts of the code for your machine is from me. How awesome is that? Couldn't have imagined that two years ago.

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#196

Two years ago I didn't know a thing about nix, NixOS or functional programming. I wanted to manage multiple machines with a sort of config file. Shouldn't be that hard, right? Removal of packages should be done automatically without explicitly removing the package. So brew and ansible failed already with those, to me at the time, pretty basic requirements. Building deb meta packages was inconvenient and they broke ev…

Thanks for your work for Nix Sandro.

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#197

I would love to see a discussion from somebody who really likes Nix on why it isn't ready for prime time yet/just play devil's advocate aloud on why it isn't the greatest thing since sliced bread. I feel like I must not be doing anything "serious" enough to need package reproducibility at that high level. I'm aware of things like git checkout/tags, package-lock.json, Cargo.lock, Docker image tags. What is a real worl…

It is ready for prime time if you are an advanced linux user already. It is the greatest thing since sliced bread if you where using Arch or Gentoo before.

Do you have more than two machines you want to keep in sync? Do you don't want to track custom patches for software? Do you want to make upgrades painless? Do you want to be forced to at least have documentation as code? Do you need to manage a multi user environment and want to know what is configured?

With NixOS you don't need to think about re-installs. They are painless and an order of magnitude easier to do. You know you will get the same configuration back.

Kubernetes is complicated and a good choice for a big team with lots of containers, but rather pointless for a single machine. NixOS already works great for a single machine and scales well for more machines but not as well as k8s. If you are building 100 different machines on hydra, you start to run into scaling problems pretty fast.

So what are actual bad points: - you must work with the nix, not against it. If you want to continue your current workflow and don't change anything, nix will be a big obstacle for you. - you need to invest some time and start climb the steeper learning curve. - documentation could and should be better, especially general guides that enable and teach you how to solve your problems yourself - smaller and bigger rough edges in places that are usually very different to classical distros

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#198
post #194

Earlier quoted context omitted.

> (Nix refers to the language, package manager, cli, community, etc) Thats wrong. It refers to exactly two things: the language and the cli that implements that and is a package manager at the same time.

So you're saying that it is not a language, package manager, cli and community, but it is a language, a package manager and a cli (and I guess we can assume that talking about the "Nix community" makes sense). How was the parent wrong again?

There is the nix language and the nix program which is a package manager and cli at the same time. There might also be the running joke in German that nix literally means nothing but there is no etc. nix does not generally refer to anything else.

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#199

I'm glad this guide is focused on flakes. If you're starting out with Nix, forget about home-manager, nix-env, and the pre-flake configuration model.

But what if I manage my home-manager configuration with flakes.

My very personal recommendation: You don't, at least on a single user machine. Instead you use one of the many dotfile managers out there and for anything package related NixOS. home-manager makes the feedback loop for editing configs managed through it very long, which slowed me personally down a lot. One place where I would recommend home-manager is, if you are not using NixOS and only manage your packages through it.

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#200

Earlier quoted context omitted.

Closing in on 20 years of existence doesn't really qualify for fad I'm just starting a serious learning journey with Nix after flirting with the idea for a few years. Mostly because I find myself endlessly working on tooling to support the projects I work on that Nix already does extremely well. The feature I am most sold on is the ability to invoke clean complex development environments, that bring themselves to exi…

It may not be a fad, but there's a lot of rose-colored hype that masks a world of tedium. New prospective users should be prepared for a lot of uphill grind with respect to configuring packages or defining their own packages. Every time I try to do seemingly simple tasks in Nix, I end up spending hours on the Nix discord channel trying to work out a solution with seasoned users (who invariably struggle to work out a…

> MacOS is still a second-class citizen in the Nix world and a fair amount of stuff doesn't work properly

and that will stay this way if Apple continues to make major and breaking changes with every update and changing MacOS more and more away from a BSD system and locking it further down.

Post reply on HN