mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-11 17:36:07 +08:00
Add fuckport
This commit is contained in:
parent
1bd25eba35
commit
1efb2c37f1
1 changed files with 15 additions and 0 deletions
|
|
@ -20,6 +20,21 @@
|
|||
rosettaPkgs.idris2
|
||||
#rosettaPkgs.coq
|
||||
# (rosettaPkgs.haskellPackages.callHackage "agda-language-server" "0.2.1" { })
|
||||
|
||||
# Kill the process with the port open
|
||||
# Used only to kill stale ghc.
|
||||
(pkgs.writeShellApplication {
|
||||
name = "fuckport";
|
||||
runtimeInputs = [ jc jq ];
|
||||
text = ''
|
||||
lsof -i :"$1"
|
||||
THEPID=$(lsof -i :"$1" | jc --lsof 2> /dev/null | jq '.[].pid')
|
||||
echo "KILL $THEPID ?"
|
||||
read -r
|
||||
kill "$THEPID"
|
||||
'';
|
||||
})
|
||||
|
||||
];
|
||||
|
||||
nix = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue