Introduce createSourcesPhase in jcli package expression

This commit is contained in:
Reinout Meliesie 2025-03-15 13:59:05 +01:00
parent bf8156b213
commit 17987ef98e
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6

View file

@ -10,17 +10,21 @@ mkDerivation {
pname = "journalctl-last-invocation" ; pname = "journalctl-last-invocation" ;
version = "2025-03-10" ; version = "2025-03-10" ;
phases = [ "installPhase" ] ; phases = [ "createSourcesPhase" "installPhase" ] ;
installPhase = '' createSourcesPhase = ''
mkdir -p $out/bin cat <<- EOF > /build/source/journalctl-last-invocation
cat <<- EOF > $out/bin/journalctl-last-invocation
#!${bash}/bin/sh #!${bash}/bin/sh
exec ${systemd}/bin/journalctl _SYSTEMD_INVOCATION_ID=\$( ${systemd}/bin/systemctl show --value --property=InvocationID \$1 ) exec ${systemd}/bin/journalctl _SYSTEMD_INVOCATION_ID=\$( ${systemd}/bin/systemctl show --value --property=InvocationID \$1 )
EOF EOF
'' ;
chmod +x $out/bin/* installPhase = ''
mkdir -p $out/bin
cp /build/source/journalctl-last-invocation $out/bin/
chmod +x $out/bin/journalctl-last-invocation
'' ; '' ;
} }