From d304353abe21350e545bfa648288d28743bbeb71 Mon Sep 17 00:00:00 2001 From: Ente Date: Mon, 16 Mar 2020 22:12:05 +0100 Subject: [PATCH] Atomic write_file --- nixos/modules/config/update-users-groups.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/config/update-users-groups.pl b/nixos/modules/config/update-users-groups.pl index 15e448b787aaf..68660df06f99d 100644 --- a/nixos/modules/config/update-users-groups.pl +++ b/nixos/modules/config/update-users-groups.pl @@ -16,7 +16,7 @@ sub updateFile { my ($path, $contents, $perms) = @_; - write_file("$path.tmp", { binmode => ':utf8', perms => $perms // 0644 }, $contents); + write_file("$path.tmp", { binmode => ':utf8', perms => $perms // 0644, atomic => 1 }, $contents); rename("$path.tmp", $path) or die; }