28 lines
457 B
Nix
28 lines
457 B
Nix
{
|
|
pkgs ,
|
|
stdenv ,
|
|
} :
|
|
|
|
with pkgs ;
|
|
with stdenv ;
|
|
|
|
mkDerivation {
|
|
pname = "journalctl-last-invocation" ;
|
|
version = "2025-03-10" ;
|
|
|
|
dontUnpack = true ;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cat <<- EOF > $out/bin/journalctl-last-invocation
|
|
#!${bash}/bin/sh
|
|
|
|
exec ${systemd}/bin/journalctl _SYSTEMD_INVOCATION_ID=\$( ${systemd}/bin/systemctl show --value --property=InvocationID \$1 )
|
|
EOF
|
|
|
|
runHook postInstall
|
|
'' ;
|
|
}
|