this post was submitted on 08 Sep 2023
33 points (97.1% liked)

Nix / NixOS

1732 readers
10 users here now

Main links

Videos

founded 1 year ago
MODERATORS
 

I agree that dockerfile's are not very reproducible. But honestly, that's not how most people use it. I believe most people just pull the already built image which is very reproducible. Anyways, I found this video interesting and thought I'd share it and get your guys thoughts.

top 12 comments
sorted by: hot top controversial new old
[–] Mattol@discuss.tchncs.de 5 points 1 year ago

Agree. The issue with reproducibility comes up mostly once you are building your own containers, many of them, and run them in production but then it can hit very hard because it becomes too expensive then to work around all of the following: Once you are hit by a problem (sometimes years after building the original one), it's hard to debug bc you can't be certain to be able to reproduce what you have. It's even difficult to just find out what is in an existing Docker container, companies are running costly scans for that. And finally you can't compose (you can mostly layer) as well one Docker container with another. Using Nix with flakes gets rid of all of that and you can still have Docker or other containers as output.

[–] onlinepersona@programming.dev 5 points 1 year ago (2 children)

flake? The experimental feature that hasn't been stabilised for multiple years, isn't officially part of the main package repository (nixpkgs), requires external tutorials and documentation because it doesn't have an official tutorial and the most official documentation on it is in a man page about nix flakes, and has split the community in flakes vs no flakes, is better than a well documented (from the beginning mind you) file which is used throughout most of the industry?

Yeah.... no

[–] lambda@programming.dev 4 points 1 year ago (1 children)

Great points! I wasn't aware of any of that. Thanks for your input! :)

[–] natecox@programming.dev 6 points 1 year ago (1 children)

I’ll disagree with the above. I’ve been using flakes for over a year now for my projects and they are fantastic for both personal use and for distributing along with a public repository.

I’ve been able to dump both Docker and asdf-vm for flake files with direnv, and am very happy with the workflow.

[–] SciPiTie@iusearchlinux.fyi 3 points 1 year ago (1 children)

Isn't you disagreeing proving OPs point concerning the splitting of the community? :)

That said: I'm completely new to nix and just like op described couldn't get my hands on in depth primary documentation or references - could you help me there and point me to a good starting point?

Thanks in advance!

[–] natecox@programming.dev 3 points 1 year ago (2 children)

Honestly the great failing of nix is that the new user experience is utterly terrible. I personally bounced off nix several times before I finally just grit my teeth and embraced the suck.

I think the best you can really do is look at the community. The nix project does have documentation but it is indecipherable, and I say this as someone who mostly likes nix and uses it daily.

https://zero-to-nix.com is a pretty good resource. I think they’re trying a bit hard to “framework” nix that maybe isn’t my preference, but the getting started guide is the best I’ve found so far.

Also, use your search engine of choice to find articles on nix, home-manager, nix-darwin (if you’re using a Mac), and find repos out there of other people’s dotfiles. Then get used to confusion and frustration for a while.

I still think that it has been worth it for me, personally… but there is real pain in the learning.

[–] mouwrice@mastodon.social 3 points 1 year ago

@natecox It is exactly this steep learning curve that pushed me away from nix and NixOS.

It's amazing what it can do but I just do not have the time and commitment to learn it. In the end, nix should be a tool and not a skill to master.

[–] SciPiTie@iusearchlinux.fyi 1 points 1 year ago (1 children)

Thanks for the link and tips! Do you have something similar specific to flakes? The basic concepts seem straight forward and actually chatgpt was of great help so far - but I can't get the feet on the ground with these fancy new packages :D

[–] natecox@programming.dev 2 points 1 year ago (1 children)

I learned to use them by looking at repos online that came with a flake.nix.

Also there’s this blog article that was helpful getting started: https://tonyfinn.com/blog/nix-from-first-principles-flake-edition/nix-7-what-about-flakes-then/

Flakes aren’t much different from regular nix configs, except that they explicitly declare their sources by url. Rather than using whatever “home-manager” your system has on it, the flake says “go get home-manager from this location and use it”.

The extra level of control makes for more reproducible configs by isolating dependencies from the system paths. At least in theory.

[–] SciPiTie@iusearchlinux.fyi 2 points 1 year ago

You're a good nugget! ♥ Thanks a lot!!

[–] tatterdemalion@programming.dev 2 points 1 year ago (1 children)

You act like non-flake nix has better documentation.

[–] onlinepersona@programming.dev 2 points 1 year ago

It is better, but better doesn't mean good.