Check and create /etc/NIXOS during activation

This commit is contained in:
oxalica 2021-07-17 01:55:00 +08:00
parent 6fb85f6a03
commit cba8b52942
No known key found for this signature in database
GPG key ID: CED392DE0C483D00

View file

@ -138,3 +138,9 @@ foreach my $fn (@oldCopied) {
# Rewrite /etc/.clean.
close CLEAN;
write_file("/etc/.clean", map { "$_\n" } @copied);
# Create /etc/NIXOS tag if not exists.
# When /etc is not on a persistent filesystem, it will be wiped after reboot,
# so we need to check and re-create it during activation.
open TAG, ">>/etc/NIXOS";
close TAG;