Add journalctl-last-invocation package
This commit is contained in:
parent
4d4691f603
commit
e280279edb
2 changed files with 37 additions and 0 deletions
|
@ -16,6 +16,10 @@ with pkgs ;
|
||||||
import packages/bookwyrm/package.nix
|
import packages/bookwyrm/package.nix
|
||||||
) {} ;
|
) {} ;
|
||||||
|
|
||||||
|
journalctl-last-invocation = callPackage (
|
||||||
|
import packages/journalctl-last-invocation/package.nix
|
||||||
|
) {} ;
|
||||||
|
|
||||||
python = {
|
python = {
|
||||||
|
|
||||||
bw-file-resubmit = callPackage (
|
bw-file-resubmit = callPackage (
|
||||||
|
|
33
packages/journalctl-last-invocation/package.nix
Normal file
33
packages/journalctl-last-invocation/package.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
pkgs ,
|
||||||
|
stdenv ,
|
||||||
|
} :
|
||||||
|
|
||||||
|
with pkgs ;
|
||||||
|
with stdenv ;
|
||||||
|
|
||||||
|
mkDerivation {
|
||||||
|
pname = "journalctl-last-invocation" ;
|
||||||
|
version = "2025-03-10" ;
|
||||||
|
|
||||||
|
dontPatch = true ;
|
||||||
|
dontConfigure = true ;
|
||||||
|
dontBuild = 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
|
||||||
|
|
||||||
|
# TODO: Check if Nix does this for us
|
||||||
|
chmod +x $out/bin/*
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'' ;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue