2025-03-10 23:54:40 +01:00
|
|
|
{
|
|
|
|
pkgs ,
|
|
|
|
stdenv ,
|
|
|
|
} :
|
|
|
|
|
|
|
|
with pkgs ;
|
|
|
|
with stdenv ;
|
|
|
|
|
|
|
|
mkDerivation {
|
|
|
|
pname = "journalctl-last-invocation" ;
|
|
|
|
version = "2025-03-10" ;
|
|
|
|
|
2025-03-15 13:53:40 +01:00
|
|
|
phases = [ "installPhase" ] ;
|
2025-03-10 23:54:40 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
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
|
|
|
|
|
2025-03-15 13:53:40 +01:00
|
|
|
chmod +x $out/bin/*
|
2025-03-10 23:54:40 +01:00
|
|
|
'' ;
|
|
|
|
}
|