TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

383 pointsby biggestlouover 2 years ago

27 comments

MuffinFlavoredover 2 years ago
I would love to see a discussion from somebody who really likes Nix on why it isn&#x27;t ready for prime time yet&#x2F;just play devil&#x27;s advocate aloud on why it isn&#x27;t the greatest thing since sliced bread.<p>I feel like I must not be doing anything &quot;serious&quot; enough to need package reproducibility at that high level. I&#x27;m aware of things like git checkout&#x2F;tags, package-lock.json, Cargo.lock, Docker image tags.<p>What is a real world use case where Nix isn&#x27;t overkill? I&#x27;ve read toolchains but... nvm (node version manager), rustup. I still Rust on a machine once and I never think about it again.<p>It feels like the Kubernetes of package management&#x2F;build if you will complexity wise. &quot;Do we really need this or is it just what everybody else is doing?&quot;
评论 #34492925 未加载
评论 #34492605 未加载
评论 #34497522 未加载
评论 #34493026 未加载
评论 #34492569 未加载
评论 #34495885 未加载
评论 #34493227 未加载
评论 #34495631 未加载
评论 #34495450 未加载
评论 #34493645 未加载
评论 #34494094 未加载
评论 #34509047 未加载
评论 #34494103 未加载
JamesSwiftover 2 years ago
UX feedback: for an opinionated guide targeted at newbies, I think the &#x27;concepts&#x27; page should be much more of a guided introduction. I click on it and have a big basket of things in _alphabetical order_. I think it should be a top-to-bottom ordering of how a user should read them if encountering for the first time. Maybe have a separate glossary page if thats what you are going for with the alphabetical order.
评论 #34491407 未加载
SuperSandro2000over 2 years ago
Two years ago I didn&#x27;t know a thing about nix, NixOS or functional programming. I wanted to manage multiple machines with a sort of config file. Shouldn&#x27;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&#x27;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&#x27;t solve my problems and it isn&#x27;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&#x27;t seem to be that complicated...<p>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. :)<p>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&#x27;t have imagined that two years ago.
评论 #34497465 未加载
whsover 2 years ago
I&#x27;m trying Nix this weekend, and I&#x27;m surprised that many part of the core nixpkgs library are mostly undocumented. For example, searching with `&quot;stdenv.isLinux&quot; site:nixos.org -site:discourse.nixos.org -site:releases.nixos.org` returns a single result in total, which only contain the one usage of the function but no other list of available stdenv.is* functions.
评论 #34493152 未加载
drakerossmanover 2 years ago
If you don&#x27;t mind, a shameless plug:<p><a href="https:&#x2F;&#x2F;drakerossman.com&#x2F;blog&#x2F;nixos-for-apt-yum-users-a-gift-that-keeps-on-giving" rel="nofollow">https:&#x2F;&#x2F;drakerossman.com&#x2F;blog&#x2F;nixos-for-apt-yum-users-a-gift...</a><p>I am doing a similar series of NixOS-related stuff, currently got only a single article out, yet quite &quot;meaty&quot;.<p>You may want to check it out for a more streamlined approach in learning nix&#x2F;NixOS which also compares it to familiar concepts from other Linux distributions. Will be releasing way more complete articles in the nearest future, hopefully within the next 2-3 weeks.
评论 #34492318 未加载
评论 #34495027 未加载
djm_over 2 years ago
As a Mac-using Python shop, we had serious file-sync performance issues when mounting our codebase inside a container via docker-compose. Nix completely freed us from them and allowed us to develop with Python natively speedily and without all the serious faff &amp; headaches that usually comes with getting reproducible builds on everyone machines.<p>If you&#x27;d like to know more, I spoke at DjangoCon Europe late last year [1] on our setup; it&#x27;s still paying serious dividends for us!<p>Happy to answer more.<p>[1] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Mx3yiE_CJOY">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Mx3yiE_CJOY</a>
评论 #34494311 未加载
0xCMPover 2 years ago
I am a huge fan of all the work Determinate Systems is doing to make Nix easier to use for everyone.
评论 #34491261 未加载
jcastroover 2 years ago
I am glad someone is doing this. There&#x27;s lots of things in nix I want to try and use but the tooling and docs are just a bridge too far for me, if someone&#x27;s going to give the initial ux a do over then I&#x27;m down for that!
评论 #34490934 未加载
aendrukover 2 years ago
&gt; Zero to Nix is opinionated because it advocates learning and using flakes and treating channels as deprecated.<p>I think I need a “Channels to Flakes”. I have an existing system configuration that seems to work fine without flakes. What am I missing out on?
评论 #34491045 未加载
评论 #34491531 未加载
评论 #34494124 未加载
jt2190over 2 years ago
Just my two cents: Nix doesn’t guarantee “reproducible”, just “repeatable”. (I think it’s helpful to keep these technical concepts distinct, and to introduce the right terminology when teaching, since it makes elaboration easier in the future.)
评论 #34492019 未加载
评论 #34492957 未加载
评论 #34495224 未加载
评论 #34492125 未加载
评论 #34492592 未加载
评论 #34492346 未加载
lynndotpyover 2 years ago
I wish guides like these contained screenshots.<p>Do people use Nix for desktop OSes? As a VM they SSH into? A collection of config scripts that they don&#x27;t directly issue commands to?<p>I certainly can&#x27;t tell from a quick glance of this guide
评论 #34491957 未加载
评论 #34496198 未加载
评论 #34491738 未加载
评论 #34491868 未加载
评论 #34491742 未加载
评论 #34491725 未加载
评论 #34492075 未加载
评论 #34495242 未加载
评论 #34491954 未加载
评论 #34493143 未加载
lackerover 2 years ago
Is Nix good at dealing with cuda dependencies? I am always frustrated trying to deploy cuda-based environments onto machines with different sorts of GPUs.
评论 #34491900 未加载
groestlover 2 years ago
Off topic, but I wonder if the authors of zero-to-nix.com are aware that their project name actually reads quite funny for German speakers (as &quot;Nix&quot; in German also means Zero)
评论 #34491694 未加载
评论 #34491625 未加载
评论 #34491605 未加载
jhoechtlover 2 years ago
I read of Nix now and then. Seems its more than a fad. Why should I invest time? What makes it stand out?
评论 #34491178 未加载
评论 #34490961 未加载
评论 #34491188 未加载
评论 #34490946 未加载
评论 #34491185 未加载
评论 #34492008 未加载
评论 #34491125 未加载
评论 #34491160 未加载
评论 #34491157 未加载
评论 #34492574 未加载
评论 #34490925 未加载
QuiCasseRienover 2 years ago
The same Zero to NixOS would be highly appreciate.
评论 #34491271 未加载
评论 #34491010 未加载
weitzjover 2 years ago
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
评论 #34497024 未加载
JoelMcCrackenover 2 years ago
I have tried several times to dig into nix and make it stick. Each time I get a little further along, but I always get to the same stuck point: things that I am trying to combine are unclear to me how they should fit together, and&#x2F;or there are just massive amounts of code for what should be a simple thing.<p>Nix flakes has indeed made it all quite a bit easier. But, sadly, in the interim, there are lots of things in an in-between state.
评论 #34492107 未加载
unsupp0rtedover 2 years ago
&gt; Welcome! It&#x27;s great to see that you&#x27;re interested in Nix.<p>I sure am! What is Nix?
anton96over 2 years ago
About NixOS, there&#x27;s something really basic that I cannot seem to grasp. I had already installed many linux distro&#x27;s with time, after the years I was really found on KDE and ZFS.<p>I&#x27;ve stumbled upon this tutorial with great interests and yet I can&#x27;t start to see what is the expected install workflow. Are you expected to write your nix config file booting on the live medium, how could you easily transfer this config file to your install medium.<p>As much as I understand that targeting the right ZFS dataset and so should not be included in box and I was still happy to find some mention of it in the official doc. I don&#x27;t understand this mix of an all seeing doc, spanning across many technologies and configurations set and yet what I could call the context is rather absent.
评论 #34494647 未加载
tripdoutover 2 years ago
Just made an account to say that I think this is great - a well structured, well explained, and most importantly guided introduction to Nix is exactly what&#x27;s needed to get into it.<p>Would also be awesome to see something like this for NixOS.
bbsimonbbover 2 years ago
What problem does this solve?
评论 #34491883 未加载
评论 #34491304 未加载
suumcuiqueover 2 years ago
I&#x27;ve been dipping my toes into the Nix ecosystem recently, having a dev environment per project with direnv is neat but how does this work with IDEs like VSCode or IntelliJ IDEA? For example, if I define a specific JDK in my project with Nix, will IntelliJ be able to pick this up? Does anyone have any good resources on how to set this up?<p>BTW, for others who just want to try it out without having to install anything on your system, there are docker containers you can use as a sandbox: docker run -it nixos&#x2F;nix bash
评论 #34492686 未加载
评论 #34492967 未加载
VWWHFSfQover 2 years ago
&gt; echo &quot;Hello Nix&quot; | nix run &quot;nixpkgs#ponysay&quot;<p>why on earth would you make # any kind of a special character in commands. who thought of that
评论 #34491622 未加载
评论 #34491802 未加载
评论 #34491946 未加载
Phlogiover 2 years ago
If I could push this to my kindle as an epub with an index. It would be great if these document frameworks would support it. At least a PDF.
评论 #34498099 未加载
评论 #34494430 未加载
MisterTeaover 2 years ago
What does opinionated mean is this case? I read through a bit and didn&#x27;t see any strong opinions.
评论 #34492243 未加载
评论 #34492033 未加载
smasher164over 2 years ago
I&#x27;m glad this guide is focused on flakes. If you&#x27;re starting out with Nix, forget about home-manager, nix-env, and the pre-flake configuration model.
评论 #34492487 未加载
AndrewUnmutedover 2 years ago
Nix and NixOS have had a similar sort of effect on me as Gentoo and FreeBSD have in the past. They have helped to expand my consciousness in the realm of systems administration and have helped me achieve new heights with my low latency audio configuration. For this reason, Nix and NixOS have become indispensable to my workflow.<p>NixOS introduces a new form of declarative configuration, fusing Gentoo&#x27;s highly configurable nature with BSD&#x27;s unified configuration file approach. For me, it&#x27;s absolutely perfect until my own laziness bites me in the butt. If you want to do a gentle dive into Nix, resist the temptation to go full &quot;NixOS&quot; and learn the Nix build&#x2F;environment system first. It will make things a lot easier for you in the long run.
评论 #34491003 未加载