How to Start Adding Modularity to your NixOS Config

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2023
  • Join as a Channel Member:
    / @librephoenix
    Join Liberapay: liberapay.com/LibrePhoenix/do...
    Join Patreon: / librephoenix
    This video will give you a few tricks you can use to make your configuration more modular. In specific we talk about separating your NixOS config into multiple files (modules) and selectively importing them using the imports list in your configuration.nix and/or home.nix.
    Associated Blog Post: librephoenix.com/2023-12-03-m...
    Links referenced:
    Nix Language Basics (nix.dev): nix.dev/tutorials/nix-language
    MyNixOS: mynixos.com/
    My configuration (if you're curious):
    GitHub: github.com/librephoenix/nixos...
    GitLab: gitlab.com/librephoenix/nixos...
    Codeberg: codeberg.org/librephoenix/nix...
    Wallpaper backgrounds were found on freepik.com.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 68

  • @mikefdorst
    @mikefdorst 7 หลายเดือนก่อน +57

    This is the most helpful nix video I have come across to date. I really appreciate you explaining what the syntax actually means. I hadn't understood that the contents of squiggly brackets were attribute sets, and just that one piece of knowledge made so many things click for me. Please keep up the good work, I'm eagerly awaiting your next video.

  • @ollitoollito
    @ollitoollito 6 หลายเดือนก่อน +12

    I have rage-uninstalled NixOS a couple of times but always been drawn back… This time I found your video series which is very helpful! Please continue!

    • @librephoenix
      @librephoenix  6 หลายเดือนก่อน +1

      Definitely! I'm glad you're finding the series helpful! :)

    • @mgord9518
      @mgord9518 2 หลายเดือนก่อน

      Me too, took me a few months of really hunkering down for it to eventually click. Very different from any traditional distro, although it's pretty much all I use now

  • @dr_regularlove
    @dr_regularlove 7 หลายเดือนก่อน +11

    I started watching this series when I finally decided to take NixOS for a spin last night. This one came out right in the nick of time and is answering a lot of my questions. From what I've seen, I think you are currently producing *the* best NixOS intro video series available. Keep em coming, and thanks! Where's your Patreon lol

  • @Illumynatii
    @Illumynatii 7 หลายเดือนก่อน +7

    Again, thank you for the detailed value rich content. You're a true asset to the Nix community

    • @librephoenix
      @librephoenix  6 หลายเดือนก่อน +5

      Thanks! Glad you're finding the videos helpful!

  • @megamindblue1732
    @megamindblue1732 5 หลายเดือนก่อน +4

    Amazing! Not only do you know the subject matter well but you are able to teach it in a digestible manner.

  • @aa898246
    @aa898246 4 หลายเดือนก่อน +1

    your series is amazing

  • @JonnyIrwin
    @JonnyIrwin 6 หลายเดือนก่อน +1

    I have been loving this video series! This video was particularly good. Can’t wait for the next one!

  • @nodupe
    @nodupe 5 หลายเดือนก่อน

    One of the best vídeos around. Great explanations!

  • @DuskyDaily
    @DuskyDaily 7 หลายเดือนก่อน +3

    Really amazing and helpful content, carry on

  • @user-fz6jj2qu9s
    @user-fz6jj2qu9s 7 หลายเดือนก่อน +4

    Great vids! I was thinking of switching from NixOS after a few months of using it, cause I was having some issues and not eough time to research and fix them, but your vids have made me want to start tweaking my system again and learn more about it.

  • @andynn6691
    @andynn6691 7 หลายเดือนก่อน +5

    This is fantastic introductory content. You have a nice and clear presentation style too 👍

  • @braaitongs
    @braaitongs 5 หลายเดือนก่อน

    Excellent video!

  • @EdvardssonTech
    @EdvardssonTech 6 หลายเดือนก่อน +1

    Great video! Really looking forward to the hyprland + nix video!

  • @adjbutler
    @adjbutler 7 หลายเดือนก่อน

    love it! thank you!

  • @Redyf
    @Redyf 6 หลายเดือนก่อน +1

    This is one of the best NixOS related videos I've seen so far, great job man!

  • @haru02w89
    @haru02w89 6 หลายเดือนก่อน +2

    Best nixOS playlist "guide" I ever seen. Thanks a lot for your effort

  • @Natervader13
    @Natervader13 2 หลายเดือนก่อน

    This is just the video I needed. Answered many questions I've had trying to learn Nix these last couple of weeks. I appreciate it greatly.

  • @ravingJuggernaut
    @ravingJuggernaut 23 วันที่ผ่านมา

    Appreciate the efforts man, also your github configuration is very readable, systematic and well documented, massive props mate :)

  • @jeffstein3242
    @jeffstein3242 2 หลายเดือนก่อน

    Great video. Going through the syntax was helpful

  • @attilapinter7141
    @attilapinter7141 6 หลายเดือนก่อน +2

    Absolutely fantastic intro series, thank you! The docs are hit and miss at best, but your videos are just fantastic. Love the way you explain everything. Finished implementing flakes, and home-manager on my test laptop, going to add the rest of the desktops configuration to it as well soon. Well done!

  • @DaEpic
    @DaEpic 7 หลายเดือนก่อน +1

    Thanks for the content

  • @JuanEsquitin
    @JuanEsquitin 6 หลายเดือนก่อน +1

    Bro you are a God Send! Thank You!!!

  • @randibprananda
    @randibprananda 7 หลายเดือนก่อน +3

    Amazing, im new in nixos and easy to understand your explain about nixos, thanks

  • @jayantjagtap1296
    @jayantjagtap1296 5 หลายเดือนก่อน

    This is the most helpful nix video thanks Bro

  • @shyonae
    @shyonae หลายเดือนก่อน

    these videos are veeery good. I took a config from a repo and edited a bit to make it mine, but now I'm really starting to understand what everything does, can't wait to watch the rest. Thanks again!

  • @123fourU
    @123fourU 4 หลายเดือนก่อน

    Amazing explanation thanks so much. I may not grasp all of them but the way to describe them in sequence and in details are top notch. You got a new subscriber wanting to learn more of Nix and NixOS. Keep up the good work!

  • @rishi2504
    @rishi2504 5 หลายเดือนก่อน

    Thank You!

  • @kugurerdem
    @kugurerdem 9 วันที่ผ่านมา

    This was a very educational content. Crystal clear. Thanks a lot :)

  • @wyfyj
    @wyfyj 5 หลายเดือนก่อน

    This is very well done. I will for sure be setting this up on my laptop. I still need fully set up my emacs. Your Doom Emacs looks nice.

  • @lavnish228
    @lavnish228 6 หลายเดือนก่อน +1

    Thanks a lot for these videos. I just got into linux and I wanted to start with NixOS because of its capability to be reproduced on other systems easily. Starting with Nix is pretty daunting and i might have changed my mind to go back to some other distro but then i found your channel. Now i am understanding how to Nix and with the upcoming tutorials I might be able to customise my setup atleast somewhat more to my liking.

  • @dacdparis
    @dacdparis 6 หลายเดือนก่อน

    Thank you very much, your videos are great.

    • @librephoenix
      @librephoenix  6 หลายเดือนก่อน

      Thanks! Glad you've found the videos helpful!

  • @sphamandlamtambo4624
    @sphamandlamtambo4624 3 หลายเดือนก่อน

    Amazing, thank you.

  • @marcuswest4572
    @marcuswest4572 7 หลายเดือนก่อน +2

    Echo mikefdorst Audio - 10, visual clarity - 10, expository clarity - 10, pertinence - 10

  • @blank6393
    @blank6393 6 หลายเดือนก่อน +2

    16:19 he says the most true thing for my apps

  • @pmmeurcatpics
    @pmmeurcatpics 3 หลายเดือนก่อน

    Oh my god I spent so much time not understanding where the "file not found" error was coming from!!! Honestly the one thing NixOS os really lacking is documentation of all sorts. The small warning "you need to stage/commit the file to git to be able to import it" would save me so much time

  • @c_j73
    @c_j73 5 หลายเดือนก่อน

    Just came here to say a massive thank you .... your way of explaining things in your nix videos just clicked for me. Massive thanks!
    Secondly..... Why oh why is this not a pinned video on any "beginner" Flakes tutorials ever made!

  • @mayorofnow
    @mayorofnow 7 หลายเดือนก่อน

    I'm new to Nix. I got about halfway through the This Cute tutorial and a few others before I got burnt out on configuration and tabled it. TH-cam just suggested this video for me, so I gave it a watch.
    One of the things that's been unclear for me is how best to use flakes. As an outsider, it's strange that the literature essentially says "configuration is old and broken; flakes are the new hotness," but also "put your imports in flake and use them in configuration." Managing one thing in two places feels gross.
    If configuration.nix is just another module and lists get merged across modules, I can make better sense of it. (Although I still think it's gross that imports go in a different file than where they're used.)
    Thanks for putting this together.

  • @canguy247
    @canguy247 6 หลายเดือนก่อน +1

    Really great video again dude. Can't wait for your next one! Any chance you are going to show doom-emacs config as an example? That one is a bit weird to set up as a newbie

  • @subhajitmishra007
    @subhajitmishra007 6 หลายเดือนก่อน +1

    Hi thanks a lot for your videos. They are extremely helpful and very well done.
    Can you go over incorporating Emacs config with Nix?

  • @callumlinington3124
    @callumlinington3124 2 หลายเดือนก่อน

    Love this video an all the others in the series - honestly a life saver! great job man, thanks! I have one question, how does the nixos-rebuild switch and home-manager switch commands know to take the hardware-configuration.nix and configuration.nix from you .dotfiles directory and not /etc/nixos?

  • @akibahmed229
    @akibahmed229 6 หลายเดือนก่อน

    smooth

  • @CrazyLuke11
    @CrazyLuke11 6 หลายเดือนก่อน

    Hey!
    I find your content very helpful. Could you maybe do a video on your browser?

    • @librephoenix
      @librephoenix  6 หลายเดือนก่อน

      Thanks! That's qutebrowser, and I'll definitely do a video at some point on it :)

  • @rishi2504
    @rishi2504 5 หลายเดือนก่อน +1

    Could you do one more on your emacs & WM setup please?

  • @gzoechi
    @gzoechi 6 หลายเดือนก่อน

    Helpful video. I found interesting that you call currying weird, a concept I think is a fundamental concept of any functional language, but you don't seem to find the "in" part weird that I haven't seen anywhere else and I find really weird.

  • @bonfireatnight3998
    @bonfireatnight3998 6 หลายเดือนก่อน +3

    Thanks for the great video, Emmet!
    It was exactly the kind of video I was looking for. When it comes to tech (or really anything), I get easily overwhelmed. So it comes natural for me to break things down and deal with one thing at a time. Actually, I got quite excited about the "homework assignment". I'll get down to it as soon as I'm over this stupid COVID infection and my brain is working again.
    There is only one thing that still confuses me about modularity in Nix. Or maybe I'm getting mixed up. Does "input" always mean "argument to function"? And is there any essential connection between inputs and imports?

    • @librephoenix
      @librephoenix  6 หลายเดือนก่อน +2

      Glad you found it helpful! Yeah, I may have said "inputs to the function" and meant the "argument(s)" I'm sometimes a little imprecise with my vocab :P tho arguments to a function definitely relate to the whole idea of input/output. In Nix, inputs can also mean "the sources or source code of a package" which is what inputs mean in a flake.nix

  • @ratoshi21
    @ratoshi21 3 หลายเดือนก่อน +2

    How do you edit the files on the host and they affect the vm?

  • @Cenot4ph
    @Cenot4ph 3 หลายเดือนก่อน

    This thing is like Terraform for Operating systems, the more i look at this.

  • @HyuLilium
    @HyuLilium 4 หลายเดือนก่อน

    New to nix, does this mean i can keep configuration.nix in with git version control in any directory i want or do I have to somehow link it to /etc/nixos/configuration.nix?

  • @doesnt_even_lift
    @doesnt_even_lift 5 หลายเดือนก่อน

    If you may want to use the same module (say a basic shell utils module) in your nixos config and also might want to use the same module elsewhere (like as a base for nix-shell dev environments on non-nix machines) is there a benefit to keeping that module in its own separate flake and repo? Can flakes be treated the same as modules?

  • @thabestsniper
    @thabestsniper 28 วันที่ผ่านมา

    How do you get your errors to be so concise?

  • @MrKristian252
    @MrKristian252 6 หลายเดือนก่อน

    What happens if the priority value is the same? Having mkForce in 2 places?

  • @s1n7ax
    @s1n7ax 4 หลายเดือนก่อน

    Bruh. Only reason why NixOS is not the most popular is because it's hard to understand. Thanks for breaking it down.

  • @clinta746
    @clinta746 4 หลายเดือนก่อน

    Some more details on why you didn't call it shell.nix would be helpful. Is that something I need to be on the lookout for? Is there a list of other filenames that should be avoided? Would it break something if you called it shell.nix?

  • @WenirR
    @WenirR 3 หลายเดือนก่อน

    Can i use wildcards in imports?

  • @ImperiumLibertas
    @ImperiumLibertas 3 หลายเดือนก่อน

    The whole git staging requirement is so opaque, not discussed, and the error message is so elusive that it's astonishing.
    I've fully bought into nix and nixos but they need to seriously invest in better error messaging.

  • @CrazyLuke11
    @CrazyLuke11 7 หลายเดือนก่อน

    First 🎉😂

  • @Redyf
    @Redyf 6 หลายเดือนก่อน +1

    Can you make a video explaining how to setup emacs using nix?

  • @CrazyLuke11
    @CrazyLuke11 7 หลายเดือนก่อน

    All my bugs are also features and NOT BUGS! 😂😅

  • @NicolasBPierron
    @NicolasBPierron 7 หลายเดือนก่อน

    Nice video which visit almost the bare minimum for making use of modules as a way to split the content as you want.
    However, knowing that the first line of a module is the function argument is not necessary for using NixOS modules. While this is true, this does not add any value for new users, it just adds extra barriers for learning about modules. Just knowing that the first line has to be there should be good enough for most people until they learn about `_module.args` or `evalModules`.