2023-11-13 23:51:49 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2023-11-13 22:22:36 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
mkTracer = name: target: exe: lib.getExe (pkgs.writeShellScriptBin name ''
|
2023-11-13 23:51:49 +02:00
|
|
|
echo "PID $PPID executed ${target}" |& ${config.systemd.package}/bin/systemd-cat --identifier=impurity >/dev/null 2>/dev/null
|
2023-11-13 22:22:36 +02:00
|
|
|
exec -a "$0" '${exe}' "$@"
|
|
|
|
'');
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
environment = {
|
|
|
|
usrbinenv = mkTracer "env" "/usr/bin/env" "${pkgs.coreutils}/bin/env";
|
|
|
|
binsh = mkTracer "sh" "/bin/sh" "${pkgs.bashInteractive}/bin/sh";
|
|
|
|
};
|
|
|
|
}
|