From 4db7061162a10c7b4ec7cbe4bf07234f3c68ce3a Mon Sep 17 00:00:00 2001 From: Scott Bronson Date: Mon, 3 Oct 2022 14:11:17 -0700 Subject: [PATCH] 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. --- nixos/modules/system/etc/setup-etc.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/system/etc/setup-etc.pl b/nixos/modules/system/etc/setup-etc.pl index be6b2d9ae71e..a048261a3df1 100644 --- a/nixos/modules/system/etc/setup-etc.pl +++ b/nixos/modules/system/etc/setup-etc.pl @@ -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,