Hello,
This is my humble, first contribution to the community.
When learning about how to build my own nixos configuration I found it valuable to visualize the structure and thought that there may be others out there who would benefit from a visual learning tool.
I would love to hear any and all feedback about how this helps or hinders, where improvements or corrections could be made etcetera.
I’ve already noted some improvements myself but as the saying goes, perfect is the enemy of good enough.
Looking forward to the feedback and really hope that it is useful.
Well done! Having diagrams and illustrations to go with a video like you have done makes it more interesting and easier to follow. I find many videos that show quick typing difficult to follow.
Really cool blog post! I was surprised to see that it’s very close to the setup I’m also using for my config (GitHub - futile/nixos-config: My NixOS configs for anyone that is interested).
Do you ever encounter issues where you want to provide something like “wayland-desktop” via home-manager but not all derivations or configuration are available via home-manager?
I suppose either modules or a mixin style is the only way to resolve this?
Good question. I haven’t encountered that yet but suspect it’s just a matter of time. As I understand it, lower-use options often aren’t directly available in home-manager so there is less maintenance overhead. They are often still accessible via extraArgs or extraConfig type options though.
The mixin concept is new to me so I had a look at your repo to get a better understanding. I would likely do a module but only due to personal preference for how the code would be organized. I’m curious what the pros and cons between them could be though.
Very interesting config by the way. You seem to have a lot of stuff going on there and a couple of different solutions from what I’ve come across so far. I’ll keep it in mind for reference down the road
Yes. I mention Eriim config/nix-flakes in the video introduction. I realize now however, that quite a few people are opting to read the blog rather than watch the video though, so I’ll update the blog accordingly today.
Generelly really like how you do that, and also love the motto
“The way out, is through”
One passage, where I really cringed, is when you say:
“Why not naming it custom_packages” … “There are no other packages to be placed here, they are all custom”
Now, two things I had never understood in such an instance, both only apply in this specific case, when multiple people deal with a configuration, and some team members might be new to Nix (admittedly rare)
1.) Why would someone avoid to name something so that is more specific, and communicates its intend clearer? Its documentation at this point.
2.) Why would anyone sacrifice this benefit just so they can type a couple of characters less.
As programmers, or people who deal with Nix configurations, we spend 5% of our time typing.
Code is usually read 10 times more often than it is written.
I love this presentation, and I get that Nix configurations and generally desktop files are not that often shared across a team, but I just cringe every time I hear that argument - also for function names and had to write you this, since you insisted so friendly, to write you any feedback that we can come up with.
Love the series, and definitely sign up for the next episodes
I had to laugh at myself when reading this because it made me remember making the same two points to someone else several years ago at a job regarding function names. Funny how things get forgotten or go unnoticed over time.
You’re correct on both points. I’ve already added an item to update my config accordingly in the future
Glad you are enjoying it otherwise. Thanks for the great feedback!
I’m new to nix(OS) and just got set up with this structure, so far it is working out great!
I’m wondering if you/anyone has any good advice on how to handle situations where most of the configuration of a package is shared by two hosts/users but there are differences. My problem is with hyprland and waybar, on my laptop I want some extra keybinds for media/brightness keys as well as a battery module in the waybar. I don’t want these on my desktop but it would be great if I was able to update a single file to change styling or to add some keybinds for both hosts.
At the moment I’m not configuring via home manager but instead using xdg.configFile for most things. I would be willing to change that if it helps the situation though.
Hi @muoscar, apologies for the super late reply, I remember seeing it months ago but must have gotten distracted.
There are a few ways you could achieve this. One way is to set up the module using toggleable options, although I have yet to delve into that myself so unfortunately won’t be of help there. Another solution can be to create a boolean attribute that is set to true on your laptop’s host module but false for everything else. Then in the wayland and/or hyprland module, check for the attribute state and only add the desired functionality under the appropriate condition.