I’m sure this is a fairly frequent question, however I haven’t seen any concrete discussion on the whys and hows of your configuration. This is primarily from my search for a solution that I enjoy using, with a primary focus on a consistent configuration across multiple machines. I can elaborate a bit on my own configuration:
- I initially, like everyone, did everything in a single
configuration.nixfile, installed some packages here, configured some things there. Once I installed NixOS on my desktop machine I needed a way to have separate machine configuration but wanted my “userland” to stay the same.
- At some point I figured out I could create machine specific configurations by having a separate
configuration.nixfiles that I symlinked from my
/etc/nixos/configuration.nixthat imported configuration files/ I had something like
graphical.nixthat configured my Plasma/graphical apps that I’d import but keep machine specific configuration in their own
- I discovered
home-managerand integrated it into my configuration as a NixOS module, moving over my dotfiles and merging them into my system configuration. I really enjoyed this, sans finding it annoying that I had to rebuild my system to get new changes for small dotfile changes, so I just symlinked parts of the config that I changed all the time instead of building it with Nix (my Emacs configuration especially).
- I then switched to the
unstablebranch for my machines with
nix-channel. After having tried out
nivfor some projects where I needed to pin dependencies and seeing a few people try it out on their configuration I switched to using it for managing my channels and overlays. This works, but due to how I’ve configured things I have to rebuild my system twice for it to update to the latest
unstableas mandated by
niv… and I managed to completely break my store by not reading the documentation on what a command did and now I can’t update anymore… which leads me to this.
I’m looking at a way to restructure my configuration and dotfiles, not really sure how yet but I liked where I was conceptually heading, a pinned
nixpkgs version that’s consistent across my machines. I might also try out using
home-manager as a regular program and not a NixOS module due to frustrations with having to build the system on minor changes.
Anyone willing to share thoughts, experiences on how they ended up with the configuration they have now, pain points, things they want to improve etc?