top | item 41318553

Nix in 100 Seconds [video]

41 points| jkarni | 1 year ago |youtube.com

16 comments

order

0x69420|1 year ago

was wondering when this guy would drop a video on nix. pleasantly surprised by the result, although i do find it funny that he had to go well over the usual 100 seconds. that's nix for you.

one benefit that doesn't get much lipservice in elevator pitches for nix, here included, is the experience of packaging. i think the average line count in my personal collection of obscure software is ~30, and that's including license/homepage metadata and other such junk -- it can make even bsd portfiles look tubby by comparison.

viraptor|1 year ago

> over the usual 100 seconds

It's a running joke now. There hasn't been a "100 seconds" video shorter than 2 minutes in a long time. Most are around 3min.

ronef|1 year ago

As a Nix foundation person - If anyone gets a 100 second pitch for Nix, dinners on me and I'm using it in the Nix marketing efforts :D

Agreed on the packaging experience for nix. We've been talking about that for a while also on the Flox side when we're working with folks.

drzzhan|1 year ago

Nix sounds cool. Nowadays when I dev my research, I usually use docker so that I can move my "machine" to any server in my lab. Not sure how I should fit Nix into my workflow.

ronef|1 year ago

There's a bunch of tutorials out there now, but what's the main case you're trying to solve for? Just an easy dev environment? There's an ecosystem out there that ease up the entry for Nix and also nix.dev does a great job as part of documentation efforts inside of the community.

marvel_boy|1 year ago

Nice explanation. But Nix is known for a steep learning curve, there is any reason for this?

Iridescent_|1 year ago

The learning curve depends strongly on what you are trying to do. Many things are very undocumented in Nix, and the interpreter being lazy creates very hard to read errors. No static typing makes everything worse.

If you are trying to configure your system using NixOS, the available options are very well documented so I personally rarely get into trouble.

Packaging an application however can be very difficult.

theshrike79|1 year ago

It's not a curve, it's a wall.

I've tried and failed twice. I think I irreparably messed up my macOS installation with tons of crap by trying.

peterbecich|1 year ago

i.i.r.c. the answer to this question is the complexity of Nix is necessary to achieve the level of assurance it provides.

" You may quickly encounter Nix language expressions that look very complicated. As with any programming language, the required amount of Nix language code closely matches the complexity of the problem it is supposed to solve, and reflects how well the problem – and its solution – is understood. Building software is a complex undertaking, and Nix both exposes and allows managing this complexity with the Nix language. " https://nix.dev/tutorials/nix-language.html

My read of this is any other build system has random elements that are usually fine but sometimes cause issues. There are no random elements in a Nix expression.

i.e. Yarn has a lockfile, but does not guarantee the system underlying the Yarn process is "locked." Nix does this down to the fundamental Linux/Mac libraries.

The upside is this complex configuration is a one-time cost for your project. Using a project configured with Nix can be simple. For instance, a Nix Flake can be set up for your project which defines your project workflow commands in the shell. These commands are completely portable.

Nix is not a virtual machine. But it does guarantee the command will run the same way on equivalent systems (unless it does something that goes outside the Nix boundary).

underlogic|1 year ago

The problem for me isn't installing packages and their dependencies but removing the dependencies when clearing a package. Too many package managers leave garbage on the system just in case and now I have packages for who knows what