Skip to content

Commit 7f753fb

Browse files
authored
nixos/systemd: Enable systemd-machine-id-commit.service (#351151)
2 parents 973b380 + 8f4b41c commit 7f753fb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

nixos/modules/system/boot/systemd.nix

+1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ let
160160

161161
# Misc.
162162
"systemd-sysctl.service"
163+
"systemd-machine-id-commit.service"
163164
] ++ optionals cfg.package.withTimedated [
164165
"dbus-org.freedesktop.timedate1.service"
165166
"systemd-timedated.service"

nixos/tests/systemd.nix

+7
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,17 @@ import ./make-test-python.nix ({ pkgs, ... }: {
8585
import re
8686
import subprocess
8787
88+
machine.start(allow_reboot=True)
89+
8890
# Will not succeed unless ConditionFirstBoot=yes
8991
machine.wait_for_unit("first-boot-complete.target")
9092
93+
# Make sure, a subsequent boot isn't a ConditionFirstBoot=yes.
94+
machine.reboot()
9195
machine.wait_for_x()
96+
state = machine.get_unit_info("first-boot-complete.target")['ActiveState']
97+
assert state == 'inactive', "Detected first boot despite first-boot-completed.target was already reached on a previous boot."
98+
9299
# wait for user services
93100
machine.wait_for_unit("default.target", "alice")
94101

0 commit comments

Comments
 (0)