To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/Vimjoyer/. You’ll also get 20% off an annual premium subscription.
The coolest thing with overlays in my opinion is that it allows you to for example in theory replace glibc with musl for all applications in nixpkgs, with just a 5 lines of code. It just feel so powerful that such a thing is even possible! Not super practical and would of course not work without issues, but still amazing!
You are one of the main reasons why I chose NixOS when I switched to Linux on my PC. I had planned Arch or Gentoo as I had used the latter in the past. The concept always appealed to me and I have been liking functional programming for a long time, but you made NixOS and especially the weird Nix syntax understandable. I am now running a setup with impermanence and ricing via Stylix on my PC and I always come back to your videos when I am unsure about some things. Although I haven‘t yet got the hang of Hyprland. Currently still on Gnome and Pantheon. But that‘s a matter of taste after all.
I literately was fighting a problem with my nixos config this morning and this video was able to help me fix it (needed to pin a zoom version)! Thank you so much!!
I feel like the description of `final` still doesn't quite explain the power of overlays. It's not just the contents of the set your returning, it's the contents of `pkgs` after *every* overlay is applied. So if you pull in vim in one of your overrides, it still benefits from any changes to vim later on. I need to double check, but I believe this even includes overlays *inside* nixos configs. it's a recursive feature, which when you really comprehend it, can lead to some shockingly powerful code. For instance, in my configs I use it to change certain programs to patch out network access on desktop systems, vs on servers where that function is needed. I can still rely on that program in global overlays too, since it becomes part of final, despite being patched inside the nixosconfiguration.
OMG this channel needs to be featured on nixos website. You are doing gods work. BTW can you make a video on disko using flake? I think a lot of people would want a setup where uou download a minimal iso and run a single nix run command to partition drive and install nixos. Also it is a little confusing how to use the same flake on a system with nixos pre installes. I would really appreciate if you make a video on this topic. Even if you dont like and sub from me. Keep it up.
I finally understand how overlays work and how to use them! But i still cant find a way to update only a single package/a single link to nixpkgs (to keep it up to date) and leave the rest of the packages untouched, do you know how to do that or where can i look? (i tried searching, but could not find anything of use)
1. define flake input url for specific nixpkgs (for example, nixpkgs-unstable) 1-1. If you don’t care about complexity, you can just inputs.nixpkgs-unstable.legacyPackages.. or if you do care simplicity, try 2 2. define overlays in flake.nix and nixpkgs.overlays in your nix config file. keep in mind, below code is pseudo code but you’ll know how it is going outputs.overlays.nixpkgs-unstable = final: prev: {nixpkgs-unstable = import inputs.nixpkgs-unstable { system=final.system; };} nixpkgs.overlays = [outputs.overlays.nixpkgs-unstable] 3. You should be able to access the package by pkgs.nixpkgs-unstable.
Thank you for your work, you are amazing! What I think is really helpful for anybody if you can can show us how can we read the documentation during the nix writing. Like javadoc or etc. Thank you if you can show us! 😊
Are you sure rodi doesn't now also contain the code to work on wayland? I believe the rofi version that is current for other linux-based distributions works on wayland.
This is damn cool. It’s a shame my only hang-up about NixOS as a new user is the drama in the community recently. I don’t understand it, I don’t think I want to understand it, and from the outside it just looks like a lot of mud-flinging by all sides (to put it politely). It doesn’t build much confidence in the distro when maintainers are quitting. Or getting banned(?) or whatever happened. All I know is I’m confused and definitely scared-off suggesting it for a professional environment for at least a year or two, despite still moving-ahead for my own personal use.
@@kexec. no, I am not confusing anything. There is a new version of mkDerivation + overrideAttrs. It was introduced in nixpkgs PR #119942. After that, you should define derivations using mkDerivation (finalAttrs: {}) instead of mkDerivation (rec {}) and then modify the resulting derivations using overrideAttrs (finalAttrs: prevAttrs: {}) instead of overrideAttrs (oldAttrs: rec {})
I feel you had to cover outputs.overlays (default output flake schema) instead of packing part since most your subscribers are nixos users, not nix developers. (even though this video is packaging video) I already saw the confusion in the comment section
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/Vimjoyer/. You’ll also get 20% off an annual premium subscription.
Thanks to you and that "no boilerplate" channel, im now enjoying nixos (:
o:
Bruh. This is the nix documentation we needed
The coolest thing with overlays in my opinion is that it allows you to for example in theory replace glibc with musl for all applications in nixpkgs, with just a 5 lines of code. It just feel so powerful that such a thing is even possible! Not super practical and would of course not work without issues, but still amazing!
You are one of the main reasons why I chose NixOS when I switched to Linux on my PC. I had planned Arch or Gentoo as I had used the latter in the past. The concept always appealed to me and I have been liking functional programming for a long time, but you made NixOS and especially the weird Nix syntax understandable. I am now running a setup with impermanence and ricing via Stylix on my PC and I always come back to your videos when I am unsure about some things. Although I haven‘t yet got the hang of Hyprland. Currently still on Gnome and Pantheon. But that‘s a matter of taste after all.
8:13 light theme jumpscare
this was totally missing, i needed this explanation years ago ...but we finally have it and with practical examples. Awesome content!
Thank you for your contribution to the entire Nix community!!!
I literately was fighting a problem with my nixos config this morning and this video was able to help me fix it (needed to pin a zoom version)! Thank you so much!!
Awesome video as always! As a suggestion, maybe we could get a video on how to run dynamically linked executables on NixOS?
I feel like the description of `final` still doesn't quite explain the power of overlays. It's not just the contents of the set your returning, it's the contents of `pkgs` after *every* overlay is applied. So if you pull in vim in one of your overrides, it still benefits from any changes to vim later on. I need to double check, but I believe this even includes overlays *inside* nixos configs. it's a recursive feature, which when you really comprehend it, can lead to some shockingly powerful code. For instance, in my configs I use it to change certain programs to patch out network access on desktop systems, vs on servers where that function is needed. I can still rely on that program in global overlays too, since it becomes part of final, despite being patched inside the nixosconfiguration.
thanks for your videos! i switched from arch to nixos, and I don't think about going back - tho still dual booting windows
wake up b.. debops, vimjoyer uploaded!
OMG this channel needs to be featured on nixos website. You are doing gods work. BTW can you make a video on disko using flake? I think a lot of people would want a setup where uou download a minimal iso and run a single nix run command to partition drive and install nixos. Also it is a little confusing how to use the same flake on a system with nixos pre installes. I would really appreciate if you make a video on this topic. Even if you dont like and sub from me. Keep it up.
3:43 not the cargo mommy dependency 😭
I feel enlightened
Could you make a video about "Auto Updating NixOS" especially in the context of flakes and and a central repository for multiple hosts?
Sure, I'll add that to the list
Thank you. I'm looking for something similar.
I finally understand how overlays work and how to use them! But i still cant find a way to update only a single package/a single link to nixpkgs (to keep it up to date) and leave the rest of the packages untouched, do you know how to do that or where can i look? (i tried searching, but could not find anything of use)
1. define flake input url for specific nixpkgs (for example, nixpkgs-unstable)
1-1. If you don’t care about complexity, you can just
inputs.nixpkgs-unstable.legacyPackages..
or if you do care simplicity, try 2
2. define overlays in flake.nix and nixpkgs.overlays in your nix config file. keep in mind, below code is pseudo code but you’ll know how it is going
outputs.overlays.nixpkgs-unstable = final: prev: {nixpkgs-unstable = import inputs.nixpkgs-unstable { system=final.system; };}
nixpkgs.overlays = [outputs.overlays.nixpkgs-unstable]
3. You should be able to access the package by pkgs.nixpkgs-unstable.
damn, just what i needed!
Thank you for your work, you are amazing! What I think is really helpful for anybody if you can can show us how can we read the documentation during the nix writing. Like javadoc or etc. Thank you if you can show us! 😊
Are you sure rodi doesn't now also contain the code to work on wayland?
I believe the rofi version that is current for other linux-based distributions works on wayland.
Not sure about other distros. It might work through xwayland
@@vimjoyer, yes,you're probably right about xwayland and rofi. Well, we can always do the test and find out.
This is damn cool. It’s a shame my only hang-up about NixOS as a new user is the drama in the community recently. I don’t understand it, I don’t think I want to understand it, and from the outside it just looks like a lot of mud-flinging by all sides (to put it politely). It doesn’t build much confidence in the distro when maintainers are quitting. Or getting banned(?) or whatever happened. All I know is I’m confused and definitely scared-off suggesting it for a professional environment for at least a year or two, despite still moving-ahead for my own personal use.
You should really teach how to use overrideAttrs with the new (finalAttrs: prevAttrs: {}) style instead of the legacy (oldAttrs: rec {}) style.
Oh. I didn't know about that form, but it brings it more in-line with the overlays system.
I think you’re confusing override and overlays. override is just overlays but only super (prev) argument
@@kexec. no, I am not confusing anything. There is a new version of mkDerivation + overrideAttrs. It was introduced in nixpkgs PR #119942.
After that, you should define derivations using
mkDerivation (finalAttrs: {})
instead of
mkDerivation (rec {})
and then modify the resulting derivations using
overrideAttrs (finalAttrs: prevAttrs: {})
instead of
overrideAttrs (oldAttrs: rec {})
@@ruroruro yeah looks promising though it only supports mkDerivation. We still need to use rec for buildPythonPackage and so on.
@@kexec. You might be glad to hear that support for builders that extend mkDerivation is also coming soon (tm). See PR #234651
👍thanks
I feel you had to cover outputs.overlays (default output flake schema) instead of packing part since most your subscribers are nixos users, not nix developers. (even though this video is packaging video) I already saw the confusion in the comment section
Yeah
first
Indeed
noooo not first
I had no idea what overrideAttrs did, but now I do! Thank you!
You lost me within 2 minutes. I think I am stupid.
This video demonstrates how possible it is to use nixos the gentoo way, using nixpkgs mojo :P