Sort the /etc/.clean file

Without sorting, the contents of /etc/.clean are likely to change on
every nixos-rebuild due to Perl's nondeterministic hash key ordering.
This commit is contained in:
Scott Bronson 2022-10-03 14:11:17 -07:00 committed by GitHub
parent 5622f58419
commit 4db7061162
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,7 +137,7 @@ foreach my $fn (@oldCopied) {
# Rewrite /etc/.clean.
close CLEAN;
write_file("/etc/.clean", map { "$_\n" } @copied);
write_file("/etc/.clean", map { "$_\n" } sort @copied);
# Create /etc/NIXOS tag if not exists.
# When /etc is not on a persistent filesystem, it will be wiped after reboot,