2022-03-14 16:41:25 +00:00
{ stdenv , lib , fetchFromGitHub , bash , wget , makeWrapper }:
stdenv . mkDerivation rec {
pname = " i p f e t c h " ;
version = " u n s t a b l e - 2 0 2 2 - 0 3 - 2 4 " ;
src = fetchFromGitHub {
owner = " t r a k B a n " ;
repo = " i p f e t c h " ;
rev = " f c 2 9 5 b f d a 4 f 9 f e a 6 e e e 9 f 6 f 3 f 2 d a b c 2 6 b 6 f 2 5 b e 4 " ;
sha256 = " s h a 2 5 6 - Y K Q 9 p R B j 2 h g P g 2 S h C q W G x z H s / n 7 k N h K R N y E l R D w H D B U = " ;
} ;
strictDeps = true ;
buildInputs = [ bash wget ] ;
nativeBuildInputs = [ makeWrapper ] ;
2022-04-08 15:50:15 +00:00
postPatch = ''
2022-03-14 16:41:25 +00:00
patchShebangs - - host ipfetch
# Not only does `/usr` have to be replaced but also `/flags` needs to be added because with Nix the script is broken without this. The `/flags` is somehow not needed if you install via the install script in the source repository.
substituteInPlace ./ipfetch - - replace /usr/share/ipfetch $ out/usr/share/ipfetch/flags
'' ;
installPhase = ''
mkdir - p $ out/bin
mkdir - p $ out/usr/share/ipfetch /
cp - r flags $ out/usr/share/ipfetch /
cp ipfetch $ out/bin/ipfetch
wrapProgram $ out/bin/ipfetch - - prefix PATH : $ {
lib . makeBinPath [ bash wget ]
}
'' ;
meta = with lib ; {
description = " N e o f e t c h b u t f o r i p a d r e s s e s " ;
license = licenses . gpl3Only ;
platforms = platforms . all ;
2022-07-19 23:47:30 +00:00
maintainers = with maintainers ; [ annaaurora ] ;
2022-03-14 16:41:25 +00:00
} ;
}