2022-04-03 18:54:34 +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-15 01:41:22 +00:00
postPatch = ''
2022-04-03 18:54:34 +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 ; {
2022-12-28 21:21:41 +00: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 " ;
2024-01-02 11:29:13 +00:00
homepage = " h t t p s : / / g i t h u b . c o m / t r a k B a n / i p f e t c h " ;
2022-04-03 18:54:34 +00:00
license = licenses . gpl3Only ;
platforms = platforms . all ;
2022-08-12 12:06:08 +00:00
maintainers = with maintainers ; [ annaaurora ] ;
2022-04-03 18:54:34 +00:00
} ;
}