I’m very much a NixOS noob, and have hacked together a working config from several sources, and have flakes and home manager enabled (but don’t really use HM properly…). There are a few things I’d like some help on:
I want to run everything on the unstable channel. Always. My machine is not used for any critical work, and I’d like to keep a rolling release.
I think I have redundant bits of config, like trying to use HM as a module, and separately at the same time. I need help on how to make it just a module (combine home.nix and flakes).
Upon booting, I have a ton of generations available, and the kernel version is not the latest. Except in an older generation. I thought I had it configured to only keep some recent generations, and use the latest kernel.
Where <hostname> can be omitted if your configuration name is the same as your hostname.
You can also use the --use-remote-sudo flag instead of calling the whole thing as root, then you don’t end up touching your user’s home dir with root permissions.
To update flakes, you need to get nix to update the flake.lock, which you do by going to the directory and running nix flake update. There’s no way to do that with one nixos-rebuild command to my knowledge.
Using --upgrade-all will update your system channels instead. When using flakes, you don’t need channels at all (and it’s probably best to avoid them, given they’re a common footgun as the only non-declarative part of a NixOS system).
Presumably half your issues stem from being confused about flakes/channels and therefore installing very different versions of things all the time…
If you use grub, NixOS will by default keep 100 generations (and kernels) around, if you use systemd-boot an infinite number of them. This will also fill up your boot directory rapidly. I’d recommend tweaking the configurationLimit.
Maybe solve those two issues first and then come back with a separate thread around all the other things you’re asking help with; keeping stuff focused will make it easier to actually resolve stuff.