2022-03-14 17:41:25 +01: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 17:50:15 +02:00
postPatch = ''
2022-03-14 17:41:25 +01: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 ; {
2022-12-18 01:39:44 +01:00
description = " N e o f e t c h b u t f o r i p a d d r e s s e s " ;
2022-03-14 17:41:25 +01:00
license = licenses . gpl3Only ;
platforms = platforms . all ;
2022-07-20 01:47:30 +02:00
maintainers = with maintainers ; [ annaaurora ] ;
2022-03-14 17:41:25 +01:00
} ;
}