summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-13 18:19:34 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-18 11:35:00 +0200
commitc8501a421806c6526a12b2f6537ab38754e9d4ff (patch)
tree8782ea440db870c69c9cf616f72e6e16ba2387af /nixos
parent11ce1cab97ccbe38ed6f276f3fbd2dd7851d05e2 (diff)
downloadnixlib-c8501a421806c6526a12b2f6537ab38754e9d4ff.tar
nixlib-c8501a421806c6526a12b2f6537ab38754e9d4ff.tar.gz
nixlib-c8501a421806c6526a12b2f6537ab38754e9d4ff.tar.bz2
nixlib-c8501a421806c6526a12b2f6537ab38754e9d4ff.tar.lz
nixlib-c8501a421806c6526a12b2f6537ab38754e9d4ff.tar.xz
nixlib-c8501a421806c6526a12b2f6537ab38754e9d4ff.tar.zst
nixlib-c8501a421806c6526a12b2f6537ab38754e9d4ff.zip
Set up /etc/machine-id before starting systemd
Otherwise, systemd will try to populate /etc, which we don't want.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/systemd.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 27ad1bdec329..afb5a9b78d8a 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -647,6 +647,10 @@ in
         # groups, in addition to those in the systemd-journal group.
         # Users can always read their own journals.
         ${pkgs.acl}/bin/setfacl -nm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal || true
+
+        if ! [ -e /etc/machine-id ]; then
+          ${systemd}/bin/systemd-machine-id-setup
+        fi
       '';
 
     users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network;