In a similar vein to a previous post, I would be grateful if you guys would have a look at my NixOS config and let me know if there are improvements needed. I use OpenSUSE Tumbleweed at the moment but love NixOS and use the unstable branch to make it ‘rolling’. I haven’t quite got my config 100% so I keep chickening out when I have a huge breakage and run back to Tumbleweed. Here’s the link My NixOS Config
Well. if the config works for you and you’re happy with it, I’m happy with it. Depends to which standards you hold yourself when it comes to configuring your OS / digital infra. Some low-hanging fruit though:
You could use nixfmt to format the config and keep it consistent (or pkgs.nixfmt-tree for a convenient wrapper)
You could use nixtamal, npins or flakes to pin your nixpkgs instead of using the dated nix-channel system. This also allows you to commit a lockfile to your repo.
home.nix is usually referred to as a home-managerentrypoint, but in your case it’s just another nixos module, which is really confusing.
The packages.nix module is a bit all over the place and longwinded. What is used for what? Why are there seemingly duplicate entries (ffmpeg_7-full and ffmpeg_8-full, gimp3 and gimp3-with-plugins). Why are there loose libraries like freetype and SDL2? Not for nix-ld since you’re not using that…
this passage in sudo.nix is really impure and insecure (especially wheelNeedsPassword = false, well it depends on who can get a hold on your system and whether it’s exposed to the internet, but you just probably shouldn’t do this)
Thanks for having a go at nixos
PS: if you’d want to use flakes, you’d have to change your autoUpgrade section to:
this is really hard to read. setup treefmt and optionally mix in deadnix. Get nixd setup and plumb treefmt in there. Enjoy automatic indentation, deadcode analysis, and if you setup your options correctly you can even get autocomplete for options under some circumstances.
As other people have said: it’s your config. Can you achieve what you want to? Do you struggle to modify it? What kind of modifications fail? If you can figure out answers to these questions it would allow people to give much more pointed feedback.
I’m sure lots of people would “roast” my setup. It doesn’t use flakes, flake-parts, aspect-oriented dendritic context or whatever, but I’ve not struggled to achieve a particular configuration goal in a long time, so I don’t really care.