Hello!
I was greatly inspired by this post Diffing NixOS configurations at the config-level , but sadly the project seems like it hasn’t had much activity since it was first posted. Huge shout out to @oddlama for doing what I’ve wanted for years! I ended up making my own much reduced and simpler version (none of the detailed dependency analysis, only some similar diff functionality, and only uses a pager instead of a proper TUI) here GitHub - kwbauson/configdiff · GitHub .
Notable differences:
- This is a standalone tool that works directly with flake references, so it should work with
nixosConfigurationsandhomeConfigurationsand similar as-is - Doesn’t need to patch
nixornixpkgs(just anIFDto use a newevalModuleswith a small patch) - The code is pretty simple (< 500 lines of nix + python) so hopefully easy to maintain and/or hack on if desired
You can test it out and see what happens when services.postgresql.enable = true on the minimal installation cd with this:
nix run github:kwbauson/configdiff github:kwbauson/configdiff?dir=test#nixosConfigurations.{base,postgresql}
You can check test/flake.nix and the github actions workflow for more examples
