summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2021-11-04 15:26:17 +0100
committerGitHub <noreply@github.com>2021-11-04 15:26:17 +0100
commitf37f1b2d01591480469773e99c7411f5ac001cf3 (patch)
tree8eba85f5796db65051a8b15ee7743d55c0d6325d
parenta9d2ce6284f3dd73cfa8af36aacbf4457135f199 (diff)
parentcba8b52942c5ab38c90b7d7425e4c8acc360656e (diff)
downloadnixpkgs-f37f1b2d01591480469773e99c7411f5ac001cf3.tar
nixpkgs-f37f1b2d01591480469773e99c7411f5ac001cf3.tar.gz
nixpkgs-f37f1b2d01591480469773e99c7411f5ac001cf3.tar.bz2
nixpkgs-f37f1b2d01591480469773e99c7411f5ac001cf3.tar.lz
nixpkgs-f37f1b2d01591480469773e99c7411f5ac001cf3.tar.xz
nixpkgs-f37f1b2d01591480469773e99c7411f5ac001cf3.tar.zst
nixpkgs-f37f1b2d01591480469773e99c7411f5ac001cf3.zip
Merge pull request #130388 from oxalica/fix/etc-nixos-tag-in-activation
-rw-r--r--nixos/modules/system/etc/setup-etc.pl6
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 eed20065087..be6b2d9ae71 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;