Nix explained from the ground up

  Рет қаралды 80,314

Surma

Surma

Күн бұрын

Пікірлер: 194
@zyansheep
@zyansheep 4 ай бұрын
I sure do love it when a random yt channel with under 1k subs and a celeste speedrun posts an in-depth technical video explaining a complicated subject intuitively!
@vikingthedude
@vikingthedude 4 ай бұрын
I think this is surma from google! Hes one of the hosts of the http 404 podcast. Jake archibald is another. Looking forward to his videos
@CoDEmanX47
@CoDEmanX47 4 ай бұрын
​@@vikingthedude It's HTTP 203 but yeah
@shamsartem
@shamsartem 3 ай бұрын
@@vikingthedude also they both work at Shopify nowadays
@abiiranathan
@abiiranathan 3 ай бұрын
He's not a random KZbinr! Trust me
@MadhavaVishnubhatla
@MadhavaVishnubhatla 3 ай бұрын
​@@vikingthedudeqq
@badluckprophet9103
@badluckprophet9103 4 ай бұрын
Always love a "I made the video I wish I'd had." Thanks for putting this together, it's very well done.
@Cammymoop
@Cammymoop 3 ай бұрын
This is very helpful, Nix needs more material that helps us understand the "Why", more stuff like this basically
@TotallyURGrandpa
@TotallyURGrandpa 4 ай бұрын
Antichamber, Celeste, and now Nix. This guy knows ball.
@psauchelli65
@psauchelli65 3 күн бұрын
I wish this video was made a year ago. So intuitive, and filling a titanic gap in documentation and education quality in the Nix community. Thank you!
@alexpage8085
@alexpage8085 4 ай бұрын
Learned a ton from this video Surma. Thanks for summarising all of this!
@shvmoz
@shvmoz 4 ай бұрын
Have been digging into nix/h-m over the last few weeks, awesome to have the algorithm send you to me pal!
@dassurma
@dassurma 4 ай бұрын
Flattered that you spent your time on my vid :D h-m has been a game changer for me. It’s like NixOS with having to give up your normal OS. The weirdest corners for me so far have been to not be able to quickly edit my config files and having to do a special dance for nvm, rustup and similar tools.
@TheSast
@TheSast 4 ай бұрын
​@@dassurma if you don't use configure those directly with nix, but simply use home-manager to place them in the appropriate location, you can use home-manager to symlink them instead, allowing for rapid iteration. You can then turn that on or off with a custom option.
@opheon
@opheon 4 ай бұрын
​@@TheSastif the files in the appropriate location are manager by h-m, wouldn't you need to rebuild with every change?
@agnishom
@agnishom 13 күн бұрын
Great video. I have seen many videos which show how to do cool thing X with Nix, but I never really understood before how the whole concept really worked
@LateefAlabiOki
@LateefAlabiOki Ай бұрын
This video should be the official introduction and overview of Nix. Please make more Nix tutorials.
@an_imminence
@an_imminence 4 ай бұрын
Most videos start where you ended. I felt like there had to be something simpler underlying all of this, and there is! Thank you so much for this. You actually explained Nix. By going through the whole math, only to then, afterwards!, show the shortcut.
@dassurma
@dassurma 4 ай бұрын
Thank you for the kind words. Means a lot.
@pederpbsds
@pederpbsds 4 ай бұрын
A good balance between handwaving nitpick details and drilling down into how it all comes together!
@adeebh.s1915
@adeebh.s1915 11 күн бұрын
The best video I've seen on nix by a mile! Thanks for making this Also I'd like to request a video on Flakes and another video on Nix vs Docker and why you moved from docker to nix as you mentioned in the video
@Rypervenche
@Rypervenche 4 ай бұрын
Extremely well done! You probably don't use this, but if you ever do a video on NixOS, I'm here for it!
@kugurerdem
@kugurerdem 2 ай бұрын
One of the best videos explaining how Nix works under the hood. Wish there was such a video when I first started using it.
@YuFanLou
@YuFanLou 22 күн бұрын
This video single-handedly improved my understanding of Nix more than any official documentation. Thank you.
@arnaudbarre6006
@arnaudbarre6006 4 ай бұрын
I loved the content, the tempo and the story: the end result is a consequence of logic steps, not something you take for granted. I just found that the music was a bit too loud.
@dassurma
@dassurma 4 ай бұрын
Thanks for the kind words. You are not the first person to point that out. I’ll keep that in mind for next time :D
@kriffos
@kriffos Ай бұрын
Yeah, the music is REALLY annoying, too loud and too repetitive. I would have aborted the video if the content was not that great. I really loved the way you explained it and the pictures you painted. Keep up the good work (and just leave out the music) ;)
@tejing2001
@tejing2001 4 ай бұрын
I like how you presented this. Building up from the basics without getting too bogged down in the details. I do have a few notes, though: 8:49 This is actually (unfortunately) not the case. Antiquotes of path types do expand to a nix store path, but builtins.toString actually returns the non-store path as a string. I consider this broken behavior, and have argued that it should be changed, but it is the current behavior. As a rule, just never use toString on a path-type. If you think you need to, then you're probably mixing eval time and run time in a way that will come back to bite you at some point. Also, it isn't exactly when a path-type is evaluated that it gets copied to the nix store (in particular, if you import a path type, it needn't be copied, and isn't), but I'm pretty much fine with glossing over that. 13:07 Yes, you did a bad thing, but perhaps more importantly, on linux, this build would have completely failed because there, builds are run inside a container without access to the host filesystem at all. Might have been good to mention. 21:12 You did a subtle bad thing here, by overriding phases without calling the pre and post hooks. This keeps the hooks from firing, and can lead to hard-to-debug behaviors as a result. This is one of the biggest causes of frustrating confusion I see for people writing their own derivations. Some construct that depends on hooks is supposed to work, but doesn't, and they can't figure out why. It's cause they overrode a phase and didn't use runHook to run the pre and post phase hooks.
@dassurma
@dassurma 4 ай бұрын
Oh cheers! Really appreciate the thorough review. I’ll add those to the video description. The remark about the hooks is interesting. That was something I definitely misunderstood and I suspect did cause a lot of headaches lol. Wrt containerization: I actually had that on my TODO list to check if you can have your build run in a container, and I never got around to it. Can derivations opt out of the containerization? Or how does bootstrapping work on Linux?
@tejing2001
@tejing2001 4 ай бұрын
@@dassurma Containerization is a nix option, controlled in nix.conf or on the command line with --sandbox or --no-sandbox. It's off by default on darwin, I think because the sandboxing tech available on darwin causes too many problems, but on linux it's on by default. The sandbox only has the closures of the store paths mentioned in the .drv available in it. Nothing else. As far as I know, there's no way for a derivation to skip containerization; if your build can't work in a container, then it really isn't a proper nix build in the first place, so it isn't really viewed as sensible to give that option, especially considering the security implications of building other people's (not necessarily trusted) derivations. Bootstrapping stdenv in nixpkgs (in linux or darwain, afaik) is done without reference to the host system, because it instead starts with a precompiled set of tools, downloaded much like source code is. Those precompiled tools are very rarely updated, and extra care is taken to ensure provenance when they are. I believe several separate groups build them independently and check that they get bit-for-bit identical results, among other things. They don't really need to be updated until you reach a point where the latest version of the compiler can no longer be built with them, anyway.
@bjeanes
@bjeanes 4 ай бұрын
Excellent video. I'll be sharing this one when people ask me to explain Nix.
@oOBromOo
@oOBromOo 3 ай бұрын
Great video, was very helpful! Interested in nix for a long time and this helps a lot to understand nix and all of its meanings better.
@iChrisBirch
@iChrisBirch 4 ай бұрын
Great video. Just enough content that I wanted to watch it all and enough teasers to make me go research some more.
@sandhilt
@sandhilt 2 ай бұрын
Please, make more videos about Nix! Amazing and astonishing content!
@DenisFalqueto
@DenisFalqueto 2 ай бұрын
This is the documentation I was looking for! Thank you so much!
@xorlop
@xorlop 4 ай бұрын
I just gave my first talk that explained similar concepts… but dang! Your explanation is amazing! This is just great!
@amanueltigistu8268
@amanueltigistu8268 3 ай бұрын
this is just a great explanation of nix that i ever heard. please make more videos about nix. Thanks.
@Loige
@Loige 2 ай бұрын
Honestly, the best nix video I have seen so far! Thanks, Surma!
@Danielo515
@Danielo515 Ай бұрын
I can't believe how approachable and interesting you made what has been up until now a very complex and hard to understand tool. Many thanks
@tyler...
@tyler... 4 ай бұрын
This is such a great video! I've never really understood the reasoning behind Nix until now, let alone how it works. Saving this one to my "most important videos" playlist
@YaroKasear
@YaroKasear 4 ай бұрын
Make more. With content of this quality you deserve more subs!
@matthiasbendewald1803
@matthiasbendewald1803 3 ай бұрын
Best video i saw this year, just awesome, THANK you!
@Mempler
@Mempler 22 күн бұрын
Holy moly, thats why i couldn't work with nix (so great, i was able to... just lots of confusion) BUT NOW IT MAKES SENSE It's a pure functional programming language! Concepts that i didnt learn just yet!
@sarahclark9256
@sarahclark9256 3 ай бұрын
Excellent as always! Good to hear your voice again. I’ve been running nixos for a couple of years and contribute to nixpkgs.
@WeshalbDennNicht
@WeshalbDennNicht 4 ай бұрын
What a great and helpful video for anyone trying to get a first, or a second deeper grasp on what Nix is and how it works. Thank you!
@wildwestrom
@wildwestrom 4 ай бұрын
This is superb! I think this is the best tutorial I've seen yet.
@TheMarkman1995
@TheMarkman1995 3 ай бұрын
This is really well done and useful, been trying to wrap my head around nix for a few months or a year at this point. Still very far down the rabbit hole to explore but this was crazy useful!!!
@kaungminkhant9790
@kaungminkhant9790 3 ай бұрын
Honestly, I love the explanation on the topic, and I would like to request more on the topic. Mind blown by how well it is presented. I myself trying out Nix and want to get started. The problem was finding where to start. Thanks a lot for the video!
@theutz
@theutz 4 ай бұрын
I needed this a year ago! But I’m happy that it’s here now. :)
@sirpiplin9948
@sirpiplin9948 4 ай бұрын
The video we needed, not the video we deserved! Amazing Job!
@nomadtrails
@nomadtrails 4 ай бұрын
Kudos on an incredibly well made video. This is absolutely the foundational knowledge I needed that fits between "Why to use" and "How to use" which are well represented elsewhere.
@ejiek
@ejiek 4 ай бұрын
Thanks! That is an amazing learning experience! Pleasant motioncanvas graphics, well pased explanation, relaxing music and colors. I'm happy that KZbin got me here. Subscribed and patiently waiting for more =]
@_____vieve
@_____vieve 2 ай бұрын
BANGER. thank you sm for this cool video. i’ll rewatch this once i try nix
@intelpakistan
@intelpakistan 4 ай бұрын
The editing and explaining of this video is insane
@At-Dawn-We-Ride
@At-Dawn-We-Ride 4 ай бұрын
Thank you for this very informative, nicely balanced video. The documentation situation for Nix is indeed not ideal, so I appreciate your work of collecting various distributed pieces of pertinent information and combining them into a "digestible" format. 👍
@EkShunya
@EkShunya Күн бұрын
where had you been hiding , great work :)
@hhhnnn9195
@hhhnnn9195 4 ай бұрын
Thank you soo much! This was the Tutorial new users need, and I felt was kind of missing by the official documentation.
@GottZ
@GottZ 5 күн бұрын
watched another video.. got this recommended.. "surma".. OH YES!! *clicked it* good job!
@Mendez_84
@Mendez_84 4 ай бұрын
I've been hearing a lot about nix recently but haven't bothered to check it out. Maybe I will take a look now. Thanks for the video
@rok4028
@rok4028 3 ай бұрын
22:56 Now that we have the Nix Trinity, can we expect a full systematic theology?
@JordanShurmer
@JordanShurmer 4 ай бұрын
Thank you Surma. excellent video
@povilasn8239
@povilasn8239 4 ай бұрын
Awesome video !!! Wish i had it when i just started learning, but you still managed to fill in some knowledge holes for me.
@blacklistnr1
@blacklistnr1 2 ай бұрын
Cool video! exactly what I needed :)) Can you please also do a follow-up on replacing docker? The way I currently see it it's more of a one-time temporary thing (e.g. nix build, nix develop). I'd be very interested to see how a production deployment would look like
@yanisfourel
@yanisfourel 4 ай бұрын
That is such an incredible video. Thatns for your hard work
@networkException
@networkException 3 ай бұрын
One can start wars over whether "with;" is encouraged or not. In my opinion, sometimes it's just the most elegant way to express yourself without repetition.
@kylemoran455
@kylemoran455 4 ай бұрын
This is great! Do flakes or home-manager next!!!
@karelispanagiotis
@karelispanagiotis Ай бұрын
great explanation, thank you.
@SinhNguyen-tz6us
@SinhNguyen-tz6us 4 ай бұрын
Great video. I loved your OTMT podcast.
@hidayattaufiqur
@hidayattaufiqur 4 ай бұрын
thank you so much for this video! such a great explanation, you're awesome!
@shmuel-k
@shmuel-k 3 ай бұрын
Great video, thank you!
@BGroothedde
@BGroothedde 4 ай бұрын
This is a really good video with a lot of care, thanks!
@DipsankarMaity
@DipsankarMaity 4 ай бұрын
Loved It. Keep the videos coming Surma.
@unimatrixz3ro226
@unimatrixz3ro226 25 күн бұрын
Its awsome this video! i really do like it
@adexiofan1232
@adexiofan1232 3 ай бұрын
This was very well done good sir.
@ivanicguildmember2844
@ivanicguildmember2844 4 ай бұрын
Elegant explanation. Much tanks for making this video. Could you also make a video explaining the machinations of NixOS too?
@oskarboer1511
@oskarboer1511 4 ай бұрын
Thank you for making this super clear explanation!
@yoyonel1808
@yoyonel1808 4 ай бұрын
at 5:49 the error message in not related to the code: /* f = */ {a, b, c}: a + b + c f {a = 1; b = 2;} # error: function called # without requirement argument 'b' It's not 'b' but 'c' (i hope :p)
@Majiy00
@Majiy00 4 ай бұрын
Great video! look forward to the next one.
@bryanhonof
@bryanhonof 4 ай бұрын
Cool, loved the visualizations!
@meyou118
@meyou118 4 ай бұрын
best description about nix - great video
@takumicrary4396
@takumicrary4396 3 ай бұрын
God what a great explanation
@peacefulexistence_
@peacefulexistence_ 3 ай бұрын
1:15 software is usually distributed as binaries since a binary has a smaller file size, less dependencies, and you can directly run it rather than compiling it (which in the case of something like Chromium would take several weeks of 100% CPU usage if you were to do it on an old office PC from 2010s, if it would even finish and not run out of RAM, which it probably would) 1:20 Firefox is Open Source, under the Mozilla Public License which is a weak copyleft license. 2:15 no, it doesn't, the source code gets compiled on a compiler farm of each Linux distro, uploaded to its repositories, and the user downloads the resulting binaries. Unless you run Gentoo.
@a-guess-at-the-riddle
@a-guess-at-the-riddle 19 күн бұрын
I'd recommend anyone to read the thesis. Its actually a good read for a thesis.
@xsharawi
@xsharawi 4 ай бұрын
This video is so well made, I'm glad I watched it!
@MrAzulay
@MrAzulay 4 ай бұрын
Great content as always, Surma! I’m also genuinely curious to how you find it work as a replacement of docker on your servers.
@leandronicolas1
@leandronicolas1 4 ай бұрын
Someone please ask for this to be added to the wiki and awesome-nix repo. Awesome video!
@roycrippen9617
@roycrippen9617 4 ай бұрын
Dude sick video!
@miquelvazquez4544
@miquelvazquez4544 4 ай бұрын
Great video! Can you elaborate on how it compares (pros and cons) with docker?
@carneloot
@carneloot 4 ай бұрын
I would love to have more videos on this series (this is now a series, right?). Personally I’d love to know more about home manager, but I’m sure there is a lot more to talk about on the nix ecosystem
@52ouls
@52ouls 3 ай бұрын
THANK YOU!!
@TheAndreArtus
@TheAndreArtus 3 ай бұрын
Mathematically a function takes 1 input and produces 1 output. Multiple arguments can be passed (and returned) as a tuple or by currying.
@ramonrames
@ramonrames 4 ай бұрын
More videos please. ❤
@badr_mo
@badr_mo 2 ай бұрын
Thanks for this video. You have touched on the very essential things that is confusing me so far. One more thing, I think I am missing something here, when building clang-s2, you've used in the derivation of glibc the clang-s1 derivation, which depends on system libraries. Doesnt that mean that eventuall clang-s2 also depend on system libraries?
@NostraDavid2
@NostraDavid2 3 ай бұрын
Yooo, that Dutch pronunciation of the research paper's title was _tight_! That was so clean! I see you live in the UK, but did you live over here for a bit or what?
@gueyenono
@gueyenono 3 ай бұрын
Do you plan on making more Nix content? Thank you very much for such a polished and informative video.
@luv2code
@luv2code 4 ай бұрын
I'm curious about how it replaces docker on your servers? I understand that you would run some bit of nix software that is sort of pinned to a specific version - like a docker image. But docker is more than that. Does nix also provide filesystem isolation and a networking layer?
@luv2code
@luv2code 4 ай бұрын
Thanks for the video, BTW. I appreciate you.
@gungun974
@gungun974 4 ай бұрын
Personally I liked both Nix and containers. The isolation of files systems and network of docker is a pure joy and the reproducibility and sandbox of building of Nix is perfect. That’s why I used nix to build docker Image that I can just run with Docker. Nix is not a Docker killer. Nix is a Dockerfile killer
@tejing2001
@tejing2001 4 ай бұрын
Nix doesn't provide the security benefits of docker, no. But honestly, that's not the main reason people use docker most of the time. Also, nixos and similar systems can certainly set up containers with those security benefits, if you want, and the nature of the nix store tends to make it rather easy to create such containers.
@leoschafer5172
@leoschafer5172 4 ай бұрын
It's possible to use a nix derivation to build a docker container (so there are no problem is someone used :latest and the docker file fails). I don't remember where the docs for this are
@pythonBlender7
@pythonBlender7 4 ай бұрын
I'm assuming your a sysadmin who uses docker like I do. There's a thing called nix she'll or something that makes a temp env for a package. That package could be your software. When you exit, the shell and envelope are gone I think and it's basically ephemeral like a container. Also if you think about it, that docker networking layer is only there because it has to be. Even if you are good at it like I am it's still an extra thing to remember and EVERYONE gets but by it the first time they try to send something to local host right? We'll if it's just on your system then you suddenly get to use local host again. That's nice right?
@abhishek.01
@abhishek.01 4 ай бұрын
Thank you!
@erwin757
@erwin757 3 ай бұрын
You talked about replacing docker. How did you do that and how do you manage your containers? I did not fully understand that jump to connecting nix with docker replacement
@janedoe5877
@janedoe5877 4 ай бұрын
Love this
@__vyre
@__vyre 4 ай бұрын
beautiful video 🙏 keep it up bro🫶
@luckydye
@luckydye 4 ай бұрын
great pacing 👍
@FuzailShaikh
@FuzailShaikh 3 ай бұрын
What i still don’t understand is why do we need all this when we already have Docker?
@TroubledTrooper
@TroubledTrooper 2 ай бұрын
I am an Arch user and I am not really looking to distro hop anymore, however I am very tempted by NixOS. It has a very mature community and I think the way it works is interesting. I would have to set off some time to get used to the userland of it, but man I am tempted just to do it. Should I? Before you say this, yes I have looked into all my usage cases and NixOS can handle all of them just fine. I would just have to get used to all the various things NixOS is good at to optimize my system and you know... as Linux users of this area, that is the _fun_ of a distro, isn't it? Agh, I am very tempted! 😄
@TroubledTrooper
@TroubledTrooper 2 ай бұрын
Also I am not looking to ever dual boot any distro or any operating system, so I wouldn't want to keep my Arch install around if I decided to do this. All in or not.
@dassurma
@dassurma 2 ай бұрын
Honestly, my recommendation is to go for arch with nix rather than go full NixOS. NixOS is attractive from a purist perspective, but I have found it impractical for a workstation (I do like it conceptually for servers tho, but haven't taken that leap yet)
@seanhdka
@seanhdka 2 ай бұрын
@@dassurmawhat makes it impractical for you? wanted to switch back to a different distro since i can't use nix at work, but to be honest i can't ever go back to something else. just being able to for example have a stable zfs release but have the newest kde release is just to good. also love the fact that my system is inherently documented, though i haven't used home manager yet
@joshaushessen2270
@joshaushessen2270 3 ай бұрын
It's a great video and an angle, I haven't seen before. Thanks for that. The only thing I didn't understand is the following: If clang has a dependency onto libc, then the hash of clang is dependent on the hash of libc. And if libc is build with clang then its hash is dependent onto clangs hash. Isn't that bad? Or why is it not?
@R24-q6b
@R24-q6b 4 ай бұрын
I really liked the video but can you tell me what did you used to create such a good quality video.
@dassurma
@dassurma 4 ай бұрын
That’s the wonderful Motion Canvas :)
@Hellbending
@Hellbending 29 күн бұрын
13:10 “Nix solves this by using Nix” Bro idk why but this sent me 🤣🤣🤣 never thought I would hear this again after the whole ‘write a C program using a Makefile’ nonsense lmao
@Kotz_en
@Kotz_en 4 ай бұрын
I love how you animated the code throughout the video. Is there a tool that performs these transitions automatically, or did you create them manually when editing the video?
@cinderwolf32
@cinderwolf32 4 ай бұрын
Motion Canvas
@Kotz_en
@Kotz_en 4 ай бұрын
@@cinderwolf32 Thanks!
@cinderwolf32
@cinderwolf32 4 ай бұрын
I think we were sorely lacking effective presentation and communication techniques for highly technical information and concepts, and I'm continually impressed by how everyone utilises Motion Canvas.
@Shujaathullakhan
@Shujaathullakhan 4 ай бұрын
its a great video. Had a doubt on how you create these videos? what is the software used?
@SpidFightFR
@SpidFightFR 4 ай бұрын
Hey! Awesome video !
@EmmanuelMess
@EmmanuelMess 4 ай бұрын
If this is actually able to compile the Qt frontend, it would be incredible, as Qt is very difficult to compile replicably, even with Docker.
@someonesalt5084
@someonesalt5084 4 ай бұрын
Top tier vid
@RonaldoHabibiDev
@RonaldoHabibiDev 4 ай бұрын
great ! Thanks !
@BboyKeny
@BboyKeny 4 ай бұрын
That's a bold claim indeed. Can it install Crisis on my Tamagochi?
NixOS: Everything Everywhere All At Once
15:10
No Boilerplate
Рет қаралды 352 М.
Tmux has forever changed the way I write code.
13:30
Dreams of Code
Рет қаралды 1 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 850 М.
NIX OS: the BEST package manager on the MOST SOLID Linux distribution
17:08
The Linux Experiment
Рет қаралды 333 М.
Ranking Linux Distributions for 2025: a tier list for my use case !
26:14
The Linux Experiment
Рет қаралды 191 М.
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 1,3 МЛН
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 337 М.
The Only Unbreakable Law
53:25
Molly Rocket
Рет қаралды 357 М.
Getting Started with Nix
25:49
OpenTechLab
Рет қаралды 78 М.
The Return of Procedural Programming - Richard Feldman
52:53
ChariotSolutions
Рет қаралды 63 М.
Matthew Croughan - Use flake.nix, not Dockerfile - MCH2022
17:25
Matthew Croughan
Рет қаралды 52 М.
(Neo)Vim Made Me a Better Software Developer
40:27
vim-jp
Рет қаралды 58 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН