From 6cfd95fc8ca6fe7cf46c43c81f670869a1929333 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Tue, 15 Oct 2024 13:35:50 -0400 Subject: [PATCH] nixos/systemd-stage-1: Order nixos activation after initrd-switch-root.target Now it's placed between initrd-switch-root.target and initrd-switch-root.service, meaning it is truly the last thing to happen before switch-root, as it should be. --- nixos/modules/system/boot/systemd/initrd.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index e7c5c81770a1..e3fadf592925 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -581,14 +581,10 @@ in { ]; services.initrd-nixos-activation = { - requires = [ - config.boot.initrd.systemd.services.initrd-find-nixos-closure.name - ]; - after = [ - "initrd-fs.target" - config.boot.initrd.systemd.services.initrd-find-nixos-closure.name - ]; - requiredBy = [ "initrd.target" ]; + after = [ "initrd-switch-root.target" ]; + requiredBy = [ "initrd-switch-root.service" ]; + before = [ "initrd-switch-root.service" ]; + unitConfig.DefaultDependencies = false; unitConfig = { AssertPathExists = "/etc/initrd-release"; RequiresMountsFor = [