From cd0f0637025118e47c9b2db9eb6eb765c23a2372 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Mon, 6 Jan 2025 00:21:21 +0000 Subject: [PATCH] openbsd.shutdown: Set paths for halt, reboot, wall --- pkgs/os-specific/bsd/openbsd/pkgs/shutdown.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/shutdown.nix b/pkgs/os-specific/bsd/openbsd/pkgs/shutdown.nix index 15c602455866..7dd7125a8823 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/shutdown.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/shutdown.nix @@ -1,8 +1,17 @@ -{ mkDerivation }: +{ + mkDerivation, + reboot, + wall, +}: mkDerivation { path = "sbin/shutdown"; - preBuild = '' - sed -i 's/4550/0550/' Makefile + postPatch = '' + sed -i 's/4550/0550/' $BSDSRCDIR/sbin/shutdown/Makefile + + substituteInPlace $BSDSRCDIR/sbin/shutdown/pathnames.h \ + --replace-fail /sbin/halt ${reboot}/bin/halt \ + --replace-fail /sbin/reboot ${reboot}/bin/reboot \ + --replace-fail /usr/bin/wall ${wall}/bin/wall ''; }