Is Nix Your New Terminal SUPERPOWER?

Поділитися
Вставка
  • Опубліковано 7 лип 2024
  • Get another discount on top of Hostinger's great pricing using this link: hostinger.com/devopstoolbox
    Or, use `DEVOPSTOOLBOX` code when checking out!
    ---
    Nix maybe most known as an operating system but it's also the largest package manager to date. In this video I'm exploring Nix basics, terminology, modern ways of doing things, and why everyone are going crazy of it!
    Ways to support this channel:
    🎓 Build a Second Brain With Neovim in Under 90 Minutes: learn.omerxx.com/courses/seco...
    📰 Become a better engineer in just 3 minutes a week: signup.omerxx.com
    ⌨️ Tech I use: kit.co/omerxx/my-battle-station
    LINKS
    ▶ github.com/omerxx/dotfiles
    ⏱ Timestamps
    00:00 - Intro
    00:52 - What is it
    01:47 - Installing a package
    03:50 - One off shells
    05:20 - Modern Nix
    08:00 - Hostinger
    09:00 - Flakes
    13:33 - NixOS
    #nix #nixos #nixpkgs #neovim #vim #nvim #tmux #terminal #config #dev #devops #software #development
  • Наука та технологія

КОМЕНТАРІ • 119

  • @devopstoolbox
    @devopstoolbox  18 днів тому +1

    Get another discount on top of Hostinger's great pricing using this link - hostinger.com/devopstoolbox
    Or, use `DEVOPSTOOLBOX` code when checking out!
    Join 2000+ subscribers getting one dev/sec/ops tip every Friday: signup.omerxx.com

    • @edhyjoxenbyl1409
      @edhyjoxenbyl1409 17 днів тому

      Hmm the graph you used is heavily outdated. Not sure where you found it, but that graph is an old capture of repology (see their website for an up to date graph).
      Nixpkgs beingis larger than the AUR, but also way fresher too
      Official package.json manifest reports a total of 117345 packages

  • @Apollo1_
    @Apollo1_ 17 днів тому +31

    Would love a full nix/nixOS series !

    • @devopstoolbox
      @devopstoolbox  17 днів тому +9

      Let's start with Nix tooling, and slowly build up toward the OS :)

    • @Apollo1_
      @Apollo1_ 17 днів тому +3

      @@devopstoolbox I’ll take anything, very little nix content that hits this quality :D

    • @devopstoolbox
      @devopstoolbox  16 днів тому +3

      @@Apollo1_ Thank you! ❤

  • @Julien-rc1bi
    @Julien-rc1bi 17 днів тому +23

    I transitioned from MacOS to NixOS a few months ago and I'm loving it. I use it for both private and professional use (as a developer). The combination of NixOS, flakes and home-manager is awesome. Yes there is a steep learning curve but to be able to declaratively manage your system outweighs the lenrning curve. Now I can have identical setup on my laptop and desktop pc and even a part of it on my MacBook. Since you can rollback from any update, i can use the unstable version without any fear of breaking my system 😅

    • @devopstoolbox
      @devopstoolbox  17 днів тому

      Sounds incredible! This is where I want to be.

    • @jjmachan
      @jjmachan 16 днів тому

      how do u compare the use of macos only apps like Arc, Linear, Raycast that are not on nixOS (linux)

    • @Julien-rc1bi
      @Julien-rc1bi 16 днів тому

      @@jjmachan I don't use any of those ones on Mac 😅 I tried for a while Arc but it was buggy to me (maybe it improved since). They are few apps that I miss on Linux but none of the ones you mentioned: DEVONthink and Photos and I still use a Mac for those two. For the web, I really like Firefox (especially for web development). For launching apps, I have a custom app launcher in my tiling window manager (Hyprland). For the rest, I use the same apps on both Mac and Linux, especially Tmux, Neovim, docker, a bunch of terminal cli, yazi... I would say especially for development involving docker images, Linux is much faster. Using flakes for my projects means I can manage not only the package dependencies (such as python packages via poetry) but also the toolings themselves (python, poetry, make...) and have everything explicitly declared in the flakes. When i use any project on another Nix ready machine (not necessarily nixos), then I am ensured to get the same exact version of all the tools and packages used for any given project and when I exit the project folder, none of them exists anymore, which is great because there is no dependency conflict between projects or the system.

    • @hamm8934
      @hamm8934 15 днів тому

      @@jjmachana few of those apps are linux knock offs

    • @eobardthawnemcoc
      @eobardthawnemcoc 15 днів тому

      ​@@jjmachannixOS isn't linux

  • @rujn
    @rujn 16 днів тому +4

    I went down the rabbit hole as well. But you should learn the nix language FIRST. It will demystify a lot of the config as a language style. It comes down to this: I want the same setup on every machine I work on. My job is to ship development environments to other devs as well, so this rabbit hole is worth it. I have seen companies using Nix for this reason as well.

  • @opposite342
    @opposite342 15 днів тому +3

    NixOS seems like a rabbit hole, but Nix itself on top of another system looks really interesting. I think using it for servers looks to be something really valuable.

  • @Majiy00
    @Majiy00 17 днів тому +3

    Love NIX!!!!! Thanks for the video.

  •  16 днів тому +1

    Top quality content, as always! Thank you!

  • @iatheman
    @iatheman 10 днів тому

    Great video. I was lost most of the time. Looks like the potential of Nix ecosystem is immense. But I quickly gave up after an hour of reading documentation, especially the crazy Nix language.

  • @xorlop
    @xorlop 17 днів тому +1

    YAY! I think this was a great intro to Nix. ❄

  • @driden1987
    @driden1987 17 днів тому +1

    Man thanks for this video, I haven't gotten into Nix at all, but it looks awesome. I had to manually build some packages for a fresh ubuntu install the other day and this looks like it could've made it funner to do (I explicitly didn't mention saving time because it looks like I'm going to be spending a lot of it getting up to speeed, heh)

    • @driden1987
      @driden1987 17 днів тому +1

      Well, NGL, all the flake things you've shown went right over my head. I'm guessing it's going to be the "legacy" way for me, seems more than enough for what I would use it for.

    • @devopstoolbox
      @devopstoolbox  17 днів тому +1

      @@driden1987 LMK how it goes.
      I'm also a 1987 model btw 😆

  • @eduardabramovich1216
    @eduardabramovich1216 16 днів тому +2

    Yeah, yeah, nixos is a rabbit hole, we all know at this point, now please create a playlist for Nix stuff and upload more tutorials about flakes and configs for neovim, shell, etc, etc, etc, etc, etc, etc, etc. We need that stuff please!

  • @rwz
    @rwz 17 днів тому +1

    I love devbox with direnv, it's amazing to not polute my entire system with project related tools.
    Also the version managment is so easy.
    Only some flakes/packages do not compile on silicon.

    • @devopstoolbox
      @devopstoolbox  17 днів тому

      1. Definitely getting there!
      2. Maybe a n00b question - isn't part of the flakes idea is that you have the instructions to build it locally so that anything eventually can support every arch?

    • @rwz
      @rwz 17 днів тому +1

      @@devopstoolbox 2. Should be, but seems like many flakes are not tested on aarch64, or some of their deps.

    • @devopstoolbox
      @devopstoolbox  16 днів тому +1

      @@rwz makes sense

  • @metoh757
    @metoh757 17 днів тому +1

    Great video, more on nix please!

  • @user-xd5gd4pc9h
    @user-xd5gd4pc9h 16 днів тому +1

    Looking forwrad to your next video!

  • @edhyjoxenbyl1409
    @edhyjoxenbyl1409 17 днів тому +14

    Graph you used is heavily outdated. See repology, where the graph was originated from. Nixpkgs have more packages than the AUR, and they are also way fresher. FThe official nix unstable channel package json, reports 117345 packages.

    • @devopstoolbox
      @devopstoolbox  17 днів тому +5

      Crazy! Just realized that. Thanks for the update, I'll try to add it on my next Nix vid!

    • @Taddy_Mason
      @Taddy_Mason 16 днів тому

      Crazy? I used to be crazy, they locked me in a room, a rubber room full of rats.

    • @devopstoolbox
      @devopstoolbox  16 днів тому +1

      @@Taddy_Mason 😂

    • @opposite342
      @opposite342 15 днів тому

      I just checked the graph. I assume that despite having CRAN (for R) and PyPi (for Python), npm was excluded cuz it's wayyyyy above everything else (2 mil and counting lmao)

    • @edhyjoxenbyl1409
      @edhyjoxenbyl1409 15 днів тому

      @@opposite342 it is excluded because it don't provide any way to easily parse the packages list, with information required by repology (name, version, source, ...)
      Repology asks some base requirements to be properly listed, see issue 649 of repology-updater repo

  • @noomondai
    @noomondai 16 днів тому

    I would argue that Nix is a functional language rather than a DSL, but great vid, appreciate going back to the old style of vids, and looking forward to more nix content cheers!

  • @mingsumsze6026
    @mingsumsze6026 15 днів тому +2

    I would say be careful don’t dive too deep into the nixos rabbit hole. Because you might end up trying to make everything “pure” but this really has no end to it

  • @huberthubert2948
    @huberthubert2948 16 днів тому

    Holy shit, This is awesome

  • @ViCantWin
    @ViCantWin 17 днів тому +6

    This is my own opinion, but I believe the true power of Nix flakes is only shown when used with NixOS. I'm new to Nix, after migrating from Arch, and I found the nix language quite hard, but after around 2 weeks, it became quite simple. I still don't understand most of what you've shown in the video, but modern nix flakes for NixOS systems has changed a lot over the years and has become quite simpler than nix over other distros.

    • @maxarendorff6521
      @maxarendorff6521 17 днів тому

      I've been using NixOS for a while but I've never seen the need to use flakes so far.

    • @h41fGOD
      @h41fGOD 17 днів тому

      The single config is very much the selling point of Nix and NixOS for me. But having a flake for my firefox extensions in home manager is great.

    • @devopstoolbox
      @devopstoolbox  17 днів тому +4

      Bare in mind I'm starting out like you, but I was looking for ways to use Nix for my personal projects and local use of non-linux machines. My intrigue started when users asked and contributed a flake configuration to my Tmux SessionX plugin (github.com/omerxx/tmux-sessionx). Ever since I'm down in the rabbit hole and it seems to only go deeper 😆

    • @c_kemper
      @c_kemper 17 днів тому

      @@devopstoolbox remember, I warned you 🤣

  • @MatthewMorrissey
    @MatthewMorrissey 12 днів тому

    This was a great intro! I gotta ask, though, what is that stand you have for your Moonlander?

    • @devopstoolbox
      @devopstoolbox  12 днів тому +1

      Thank you!
      This is the ZSA Platform. Quite pricy, but I love it.
      You can find some 3D-printable ones on their website if you don't want to spend this much on a tenting kit

  • @adrianscarlett
    @adrianscarlett 16 днів тому +1

    I was hoping flakes would be a simple toggle in the installer by now.
    Ideally I'd, make the first thing the installer presents to the user an option to select a github repo so they can use or clone a systemConfig

    • @devopstoolbox
      @devopstoolbox  16 днів тому

      It’s still an “experimental” feature that half of the community is against 🤷‍♂️

  • @emilnordgard5228
    @emilnordgard5228 17 днів тому +2

    Initial overhead of a nixos system can be alot. But if you structure it well (easier said than done). It's rather cumbersome.

    • @devopstoolbox
      @devopstoolbox  17 днів тому

      TRUE. I did my best here and I don't think it's remotely close to perfect. But since I couldn't find one place to get started that's not seriously debated, and I was SWAMPED in information, I wanted to start from the "guide I wish I had"

  • @theIbraDev
    @theIbraDev 16 днів тому

    Tried setting up nixos. One giant issue with it is that i can’t use it without doing major changes to my configs.
    I feel like the documentation, is really scattered, and hard to find what i’m looking for

  • @AdamS-lo9mr
    @AdamS-lo9mr 12 днів тому

    ok. I installed nix on fedora and installed some hyprland stuff, waybar, and wofi. Currently installing a s**tload of dependencies that seems excessive, and its worrying me. Is this a normal thing when using using nix on a non-nixos distro?

  • @Subbeh2
    @Subbeh2 16 днів тому +1

    Awesome stuff. What are some good resources to learn more about Nix?

    • @devopstoolbox
      @devopstoolbox  16 днів тому +1

      Great question 😉 this is one the problems. Nobody knows, there’s tons of docs, there’s a lively subreddit, flakes dedicated platforms, but nothing central that I found…
      nix.dev and zero-to-nix.com/ are good options to start with

    • @Subbeh2
      @Subbeh2 16 днів тому +1

      @@devopstoolbox thanks! I'm about to nuke my old laptop and give it a go

  • @IShaderI
    @IShaderI 16 днів тому +1

    Whats the minimal browser thing he used? Or it just editing magic?

    • @devopstoolbox
      @devopstoolbox  16 днів тому +1

      It’s actually Arc with a minimized sidebar, but if your after a minimal option try Min

  • @Danielo515
    @Danielo515 16 днів тому +2

    Clicked the like and subscribe, with the bell icon, but my nix config still does not work. What did I do wrong?

    • @devopstoolbox
      @devopstoolbox  16 днів тому

      Strange. Try liking all the videos on the channel that should definitely do it

    • @Danielo515
      @Danielo515 16 днів тому

      @@devopstoolbox I did that already! I will try to dislike a then like them again. By the way, have you heard about devbox?

    • @devopstoolbox
      @devopstoolbox  15 днів тому

      @@Danielo515 of course. On it 😉

  • @_fr3d_
    @_fr3d_ 17 днів тому +2

    This was an excellent intro into NIX. I’m looking for a way to operate remotely and machine agnostic, this is the way.

    • @devopstoolbox
      @devopstoolbox  17 днів тому

      Yep! Definitely exploring that idea and hopefully I'll be able to release the video at some point

  • @AlaaSaidAhmad
    @AlaaSaidAhmad 17 днів тому

    Hi can you make a tutorial for beginners how to customize the terminal

    • @devopstoolbox
      @devopstoolbox  17 днів тому

      Does this work? ua-cam.com/video/yCgieVu13VQ/v-deo.htmlsi=5zJPqTw_SnrXz-yX
      Or do you have something else in mind?
      I did think of making something "from scratch", I just wonder whether this answers the request or no...

    • @AlaaSaidAhmad
      @AlaaSaidAhmad 16 днів тому

      @@devopstoolbox not. Help enough sir and thank you for your time

  • @benarcher372
    @benarcher372 16 днів тому +3

    Nope. Still don't get it. Not even the package management! 🙂 I'm on macos. Don't I need to install 'something' before I can use terminal commands like 'nix-env'. Thanks for this introductory video! And will not packages installed by Nix clash with the previously packages installed by brew? So many questions.

    • @devopstoolbox
      @devopstoolbox  16 днів тому +1

      Yep I had hard time getting it too 😅
      But when I figured *anything* can become a flake, including my esoteric tmux plugin, and receive build instructions so it can literally run anywhere, I started digging

    • @TheBearmoth
      @TheBearmoth 16 днів тому +3

      Combining it with direnv and you can automatically create and start/stop temporary shells with your required dependencies when you cd in/out of your project is pretty neat! Localised environments, configured as code in your repo, without the overhead of running Docker :D

  • @angeldude101
    @angeldude101 16 днів тому +3

    Nix is certainly one heck of a rabbit hole. Hard to get into if you're new, and even harder to get _out_ of if you're not.

  • @glyakk
    @glyakk 14 днів тому

    I was with you up until you started talking about flakes. It seemed like you started hopping around in and out of environments(nix-shells?) without much explanation as to what was happening, and that is the part I am trying to wrap my dense head around. I understand that a flake is a way to kinda provide 'everything for a project' but when a flake is created does it become part of the OS or do you have to 'jump into it' every time you want to use something that is in the flake? For instance, lets say I want to add a few programs or configurations into a flake so I don't mess with my base system. As far as I understand I have to 'go into' the flake to use them correct? what if I decide I want this config to live on my main system now do I 'merge' the flake it with my system or what am I missing?

  • @summerWTFE
    @summerWTFE 17 днів тому +2

    Nix is a great idea with a horrible implementation. Sure, it can install a command line tool if you're lucky somebody maintains is. As soon as your setup becomes a little more advanced debugging anything becomes cumbersome. And if you're using Flakes you have to submit your hardware config with the repo --- so you can't have a single repo unless you submit the config from all the computers you want to use it with. Which kinda defies the whole purpose of having a config that you supposedly should be able to deploy in minutes anywhere. 🤣

    • @Gunzy83
      @Gunzy83 16 днів тому

      This. There is no bridge between the simple hello world examples and a more complex real world use case. I just want a list of binary dependencies and for the environment to keep my node modules up to date on entry. Gotask can run conditional commands that watch package.json and package-lock.json and .tool-versions for ASDF to achieve this. Spent a week trying to do this with nix and dropped in favour of a solution that was working in about 3 hours using gotask and ASDF. I'd love to learn nix but I'm time poor and have shit to do.

  • @RazoBeckett.
    @RazoBeckett. 17 днів тому +1

    I want to jump on NixOS but my Arch don't wanna screw up or give problem so no chance, and ya I use Arch, Btw.

    • @devopstoolbox
      @devopstoolbox  17 днів тому +1

      😆
      Why not both?
      If I can use it macos, I'm sure there's a selling point for arch users...?

    • @RazoBeckett.
      @RazoBeckett. 16 днів тому

      @@devopstoolbox authenticity...i guess

  • @RenderingUser
    @RenderingUser 17 днів тому +1

    0:26 thats just the stable tho...
    unstable on the other hand...

  • @catwhisperer911
    @catwhisperer911 17 днів тому +1

    Brew is hugely more supported on the Mac than nix is and it's much simpler to use if all you want is a Mac OS compatible package manager.

    • @RegrinderAlert
      @RegrinderAlert 17 днів тому +3

      That's not the point of Nix and despite being "less supported", nix is rock-solid and almost unbreakable compared to homebrew.

    • @c_kemper
      @c_kemper 17 днів тому +1

      Apples and oranges…

    • @devopstoolbox
      @devopstoolbox  17 днів тому +2

      Mostly true, especially for other apps, but like others mentioned, there's other selling points - extreme reproducibility, the one-off shell tools and that configurable environment.
      Brew is good with packages and especially wide range of GUIs, but it's something different...

    • @catwhisperer911
      @catwhisperer911 17 днів тому

      @@c_kemper I like fruit :)

    • @catwhisperer911
      @catwhisperer911 17 днів тому

      @@RegrinderAlert What part of what I said is not the point? Is it that it brew has a magnitude more support? No, it can't be that because that is true. Is it that brew is simple to use because it does one thing and does it well? No, it can't be that because that is true. Blind loyalty can sometimes short circuit one's critical thinking.

  • @mvaldes
    @mvaldes 16 днів тому

    I spent 2 hours today trying to build a package in nix and it never worked. Best 2 hours of my day, while also hating myself.

  • @celestialbeing4767
    @celestialbeing4767 16 днів тому +1

    Nixos is not for newbies. Has very unique approaches to handling packages. Unlike other distros.

  • @TheSast
    @TheSast 17 днів тому +1

    ❄️

  • @simquinoa2030
    @simquinoa2030 15 днів тому

    I TOLD YOU THE NIX VIDEO WAS COMING

    • @devopstoolbox
      @devopstoolbox  15 днів тому

      😅

    • @simquinoa2030
      @simquinoa2030 15 днів тому

      @@devopstoolboxThank you! Nix is awesome but tutorials like this are few and far between!

  • @emilnordgard5228
    @emilnordgard5228 17 днів тому +1

    Nixos is better for containers than docker! ... Most of the time.

    • @devopstoolbox
      @devopstoolbox  16 днів тому

      I definitely want to explore this idea. I’ve been working with containers for a decade. Can you recommend some content / references?

  • @Lebastian
    @Lebastian 16 днів тому

    i just wish i knew how to replace my dev environment from asdf to flakes, but i can't find a tutorial. i currently developing react native on Mac os and i need node, java and ruby. ASDF works great changing binaries from system to a specific version but nix seems to be good knowledge to have

    • @Gunzy83
      @Gunzy83 16 днів тому +1

      ASDF is fine. It's the tool of choice if you are time poor and actually need to get shit done.

  • @Redyf
    @Redyf 17 днів тому +1

    NIX MENTIONED LETS GO

  • @nicholasantidormi6238
    @nicholasantidormi6238 16 днів тому

    Nix, istant like

  • @naranyala_dev
    @naranyala_dev 16 днів тому +1

    nix + hyprland

  • @KingCrunch82
    @KingCrunch82 15 днів тому

    I tried NixOS and actually it is a mess. You can see at packages and configuration, that maintainers and contributors dont have a common vision. If you already use a Linux distribution and you are happy with it: Just ignore Nix/NisOS for your own mental health. Especially If you want to keep your real Linux next to it: Dual Boot ist nothing NixOS likes

  • @gnom-om
    @gnom-om 17 днів тому +1

    arch is better btw

    • @RegrinderAlert
      @RegrinderAlert 17 днів тому

      Can't think of a single advantage Arch has over nix other than requiring little knowledge to setup.

    • @devopstoolbox
      @devopstoolbox  17 днів тому

      I WON'T BITE 😅

    • @user-bi3du7or6e
      @user-bi3du7or6e 16 днів тому +1

      ​​@@RegrinderAlertunlike nixOS, Arch has true documentation/wiki

  • @kamalkamals
    @kamalkamals 13 днів тому

    nix not exist in ur dotefiles hhhh

    • @devopstoolbox
      @devopstoolbox  13 днів тому

      Wasn’t pushed remotely yet… needs some cleaning up. It will be soon though 🤞