Best Series on nix ever Period 😭 For fist time in my life, i actually understood nix and declarative.... i have been using nix for 6-8 months having no idea what's going on, today i understood
Just a few notes: - Options are declared in the `options` attribute set, and defined in the `config` attribute set. - Presenting `if .. then .. else ..` in the context of modules is a recipe for infinite loop as soon as you want to wrap more than a single option definition, which is why `mkIf` got introduced. Apart from that, this is a nice walk-through on how to add variability to existing`configuration.nix` / `home.nix` modules, which starts to make sense as soon as you want to reuse code with some minor differences.
Thank you for your videos. How you explain NixOS really makes it click for me and helps to organize the initial confusion about what the configs job is, what a flake does differently (and especially that it's not a 1:1 replacement for the configuration.nix-file, but rather another way to read it) and where home-manager comes in, and what it does.
Excellent. What I really like about your explanations is that they include *what's really happening*. So the config/options things and how omitting both is really a shortcut makes everything make sense. And even the little things, such as : "attribute set containing an attribute set" where others say slightly inaccurate things like "nesting curly braces is a shorthand for the dots". Btw: how different data types merge would be an interesting thing to go over at some point.
Love your videos, you are a great teach ie explaining everything thoroughly and how different components connect to each other. Would love to see videos going through source code and explaining and teaching and building awesome stuff 😃
You are doing the Lords work here. Thanks for these vids. I am using these as my primary source to setup my Nixos config coming from just having a single home-manager setup
The context how to use modularity is very important to manage your settings for the settings that are important to you. The context shows how to use the nix programming language in real use cases that can benefit development as well als corporate as home lab environments. 😊 Showing the modularity with NixOs on a rasberry Pi and a x64 architecture could show that the work of modularity pays of big time in heterogenous NixOS environments. As a proxmox user i would love to see debian replaced as a base distro some day. But right now we should use NixOS to share our configurations without hazzle.
hello Librephoenix i love to see a video on nixos neovim config as there are many ways configuration nvim on nix but i cant find the a reliable way to do so and there are things like nixvim but dot hove support of lazy . i would love to see how you manger your nvim config , i know you use Emacs and your primary editor .
I understand that's not inside a terminal. He launched the browser and he have x-ray defined in Hyprland so you're able to see through the window. Seems that he's also using emacs so that's probably from where he launched it. For more in-depth he must have this configured somewhere in his dotfiles.
There is one thing that confuses me ever since I've started reading up on NixOS. We write this system configuration file. The file defines a lambda expression. That is, if we would import the file manually, we would have to provide an attribute set with the arguments for the function parameters. As return value we would receive an set whose attributes Nix "understands". Now, of course this is not what we actually do. We run `nixos-rebuild` based on the content of this file. So, where to the arguments for the parameters come from? Until watching your videos I thought that the input `config` value comes from the _previous_ system generation. I thought it was there to make aspects of the _coming_ configuration depend on how things previously were. However, after your video I suspect things are much more... circular?! Take the example where packages are installed based on the Window Manager that is to be used. In `if config.` gets its value from the _output_, doesn't it? I mean, it asks whether _in the configuration we are currently defining_ we will use this or that window manager? Something about this I find very confusing. I guess it works somehow because of the lazy property of the Nix language. Still, would this mean that I wouldn't be able to produce the output if I removed `config` from the inputs? And would this mean that this wouldn't work because the output couldn't be its own input anymore? Anyway, thanks very much for your great videos! With every new production things are gradually making more sense.
I'm not sure I follow your question, but I think your concept of inputs and outputs is off. There is no in and out, there is no before and after. There are just attributes with values. The order you declare them makes no difference. If you declare thing A in terms of thing B, all that matters is B is declared somewhere.
What I got from these videos is that the NixOS utilities import the function exported by your configuration and call them with the attribute set, then makes use of the result. In the JavaScript world, this would be like Webpack or ESLint making use of an exported function: const createConfig = (webpackContextOrSomething) => ({ ... /* webpack options */ }); export default createConfig;
How would something like this work if you were using startx and wanted to switch between two window managers such as awesome or xmonad? How would you pass an option to change both the xinitrc and the window managers?
Hmm.. That sounds like something different entirely, because with this framework it would imply that you have one wm installed at a time, and you merely are rebuilding your system to switch to a different wm. You could try making wrapper scripts using pkgs.writeShellScriptBin. For example, if you include both of these in environment.systemPackages or home.packages, it might do what you're thinking: (pkgs.writeShellScriptBin "startxmonad" ''# write a script here to use startx to start xmonad''') and (pkgs.writeShellScriptBin "startawesome" ''# write script here to use startx to start awesome'')
Your work in this playlist on NixOS is reeeeeeealy helpful. I got to know NixOS from like 3 weeks ago and without a doubt, your content is easily one of the best 3 educational resources I found online. Thank You, I really appreciate your work. With your technical explanation superpowers , I hope you make a playlist about emacs for total beginners 😅. keep rolling this great content
Of all the Nix instructors out there, I find myself coming back to LP. Very methodical. Why do you rebuild? You can just test Do you have some sort of 'learning hub'?
Best Series on nix ever Period
😭 For fist time in my life, i actually understood nix and declarative....
i have been using nix for 6-8 months having no idea what's going on, today i understood
Forgot to say thank you ❤️
This video just saved me hours of tinkering... especially the part that explains why a config set must be created when some option declaration exist.
Not a programmer. New to Nix. This series is great!
Just a few notes:
- Options are declared in the `options` attribute set, and defined in the `config` attribute set.
- Presenting `if .. then .. else ..` in the context of modules is a recipe for infinite loop as soon as you want to wrap more than a single option definition, which is why `mkIf` got introduced.
Apart from that, this is a nice walk-through on how to add variability to existing`configuration.nix` / `home.nix` modules, which starts to make sense as soon as you want to reuse code with some minor differences.
Thank you for your videos. How you explain NixOS really makes it click for me and helps to organize the initial confusion about what the configs job is, what a flake does differently (and especially that it's not a 1:1 replacement for the configuration.nix-file, but rather another way to read it) and where home-manager comes in, and what it does.
Very nice series of videos. Thank you for doing this!
Excellent. What I really like about your explanations is that they include *what's really happening*.
So the config/options things and how omitting both is really a shortcut makes everything make sense.
And even the little things, such as : "attribute set containing an attribute set" where others say slightly inaccurate things like "nesting curly braces is a shorthand for the dots".
Btw: how different data types merge would be an interesting thing to go over at some point.
Love your videos, you are a great teach ie explaining everything thoroughly and how different components connect to each other.
Would love to see videos going through source code and explaining and teaching and building awesome stuff
😃
You are doing the Lords work here. Thanks for these vids. I am using these as my primary source to setup my Nixos config coming from just having a single home-manager setup
Thanks! I'm glad the videos have been helpful to you :)
Exactly what I have been looking for, thanks!
Cool video, very nicely explained
Maybe one thing you could have mentioned in this video is how to do string concatenation in Nix. But great video again.
Amaizing, Thank you so much! Questioin: what is the browser you are using in the video when browsing github 11:25 ?
Glad you found it helpful! Qutebrowser is my browser of choice: qutebrowser.org/
Love the content. Helped me understand a lot.
But literally sounds normal at 1.25x 😂
The context how to use modularity is very important to manage your settings for the settings that are important to you. The context shows how to use the nix programming language in real use cases that can benefit development as well als corporate as home lab environments. 😊
Showing the modularity with NixOs on a rasberry Pi and a x64 architecture could show that the work of modularity pays of big time in heterogenous NixOS environments.
As a proxmox user i would love to see debian replaced as a base distro some day. But right now we should use NixOS to share our configurations without hazzle.
hello Librephoenix i love to see a video on nixos neovim config as there are many ways configuration nvim on nix but i cant find the a reliable way to do so and there are things like nixvim but dot hove support of lazy . i would love to see how you manger your nvim config , i know you use Emacs and your primary editor .
how did you get qutebrowser top open in the terminal?
I understand that's not inside a terminal. He launched the browser and he have x-ray defined in Hyprland so you're able to see through the window. Seems that he's also using emacs so that's probably from where he launched it. For more in-depth he must have this configured somewhere in his dotfiles.
We'll explore every angle
There is one thing that confuses me ever since I've started reading up on NixOS. We write this system configuration file. The file defines a lambda expression. That is, if we would import the file manually, we would have to provide an attribute set with the arguments for the function parameters. As return value we would receive an set whose attributes Nix "understands".
Now, of course this is not what we actually do. We run `nixos-rebuild` based on the content of this file. So, where to the arguments for the parameters come from?
Until watching your videos I thought that the input `config` value comes from the _previous_ system generation. I thought it was there to make aspects of the _coming_ configuration depend on how things previously were. However, after your video I suspect things are much more... circular?!
Take the example where packages are installed based on the Window Manager that is to be used. In `if config.` gets its value from the _output_, doesn't it? I mean, it asks whether _in the configuration we are currently defining_ we will use this or that window manager?
Something about this I find very confusing. I guess it works somehow because of the lazy property of the Nix language. Still, would this mean that I wouldn't be able to produce the output if I removed `config` from the inputs? And would this mean that this wouldn't work because the output couldn't be its own input anymore?
Anyway, thanks very much for your great videos! With every new production things are gradually making more sense.
I'm not sure I follow your question, but I think your concept of inputs and outputs is off. There is no in and out, there is no before and after. There are just attributes with values. The order you declare them makes no difference. If you declare thing A in terms of thing B, all that matters is B is declared somewhere.
What I got from these videos is that the NixOS utilities import the function exported by your configuration and call them with the attribute set, then makes use of the result.
In the JavaScript world, this would be like Webpack or ESLint making use of an exported function:
const createConfig = (webpackContextOrSomething) => ({ ... /* webpack options */ });
export default createConfig;
If-then-else in nix is like the ternary operator in scripting languages.
How would something like this work if you were using startx and wanted to switch between two window managers such as awesome or xmonad? How would you pass an option to change both the xinitrc and the window managers?
Hmm.. That sounds like something different entirely, because with this framework it would imply that you have one wm installed at a time, and you merely are rebuilding your system to switch to a different wm. You could try making wrapper scripts using pkgs.writeShellScriptBin. For example, if you include both of these in environment.systemPackages or home.packages, it might do what you're thinking: (pkgs.writeShellScriptBin "startxmonad" ''# write a script here to use startx to start xmonad''') and (pkgs.writeShellScriptBin "startawesome" ''# write script here to use startx to start awesome'')
I honestly couldn't find a list of lib.types besides your blog post. Reading source code isn't very friendly for sure.
Your work in this playlist on NixOS is reeeeeeealy helpful. I got to know NixOS from like 3 weeks ago and without a doubt, your content is easily one of the best 3 educational resources I found online. Thank You, I really appreciate your work.
With your technical explanation superpowers , I hope you make a playlist about emacs for total beginners 😅.
keep rolling this great content
Of all the Nix instructors out there, I find myself coming back to LP. Very methodical. Why do you rebuild? You can just test Do you have some sort of 'learning hub'?