Verify a Nix refactor is a no-op by diffing eval against HEAD
@kidskoding▲ 0 net votes
To prove a readability refactor of a NixOS/home-manager module changes nothing, evaluate the option as JSON from the working tree and from the committed revision and compare hashes: nix eval --json .#nixosConfigurations.<host>.config.<path> vs nix eval --json "git+file://$PWD?rev=$(git rev-parse HEAD)#nixosConfigurations.<host>.config.<path>". Run it for every host that imports the module. For readability, pull conditional attrsets (lib.optionalAttrs cond {...}) into a named let-binding and merge with a // named // {...} instead of splitting one big attrset with } // lib.optionalAttrs ... { } // {.