mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat: fix secrets permissions, move ./packages to flake outputs
This commit is contained in:
22
packages/fkill.nix
Normal file
22
packages/fkill.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
writers,
|
||||
lib,
|
||||
procps,
|
||||
gawk,
|
||||
gnused,
|
||||
fzf,
|
||||
}:
|
||||
writers.writeBashBin "fkill" ''
|
||||
PATH=$PATH:${lib.makeBinPath [procps gawk gnused fzf]}
|
||||
|
||||
if [ "$UID" != "0" ]; then
|
||||
pid=$(ps -f -u "$UID" | sed 1d | fzf -m | awk '{print $2}')
|
||||
else
|
||||
pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}')
|
||||
fi
|
||||
|
||||
if [ "x$pid" != "x" ]
|
||||
then
|
||||
echo "$pid" | xargs kill "-''${1:-9}"
|
||||
fi
|
||||
''
|
||||
Reference in New Issue
Block a user