diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index 472c72fb3889..e731814bd5d4 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -703,10 +703,11 @@ in "|stage1panic" ]; }; - script = '' - echo c > /proc/sysrq-trigger - ''; - serviceConfig.Type = "oneshot"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.coreutils}/bin/echo c"; + StandardOutput = "file:/proc/sysrq-trigger"; + }; }; }; };