diff options
author | oxalica <oxalicc@pm.me> | 2021-07-17 01:55:00 +0800 |
---|---|---|
committer | oxalica <oxalicc@pm.me> | 2021-07-17 01:55:00 +0800 |
commit | cba8b52942c5ab38c90b7d7425e4c8acc360656e (patch) | |
tree | 04db2f4d83669f79da313fd82644b9b02a67a8d7 /nixos/modules/system/etc | |
parent | 6fb85f6a03626f946076050d918e4b47eb668c58 (diff) |
Check and create /etc/NIXOS during activation
Diffstat (limited to 'nixos/modules/system/etc')
-rw-r--r-- | nixos/modules/system/etc/setup-etc.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/modules/system/etc/setup-etc.pl b/nixos/modules/system/etc/setup-etc.pl index eed20065087fa..be6b2d9ae71ef 100644 --- a/nixos/modules/system/etc/setup-etc.pl +++ b/nixos/modules/system/etc/setup-etc.pl @@ -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; |