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 " ;
2024-07-01 15:47:52 +00:00
version = " u n s t a b l e - 2 0 2 4 - 0 2 - 0 2 " ;
2022-04-03 18:54:34 +00:00
src = fetchFromGitHub {
owner = " t r a k B a n " ;
repo = " i p f e t c h " ;
2024-07-01 15:47:52 +00:00
rev = " 0 9 b 6 1 e 0 d 1 d 3 1 6 d b c f a b 7 9 8 d d 0 0 b c 3 f 9 c e b 0 2 4 3 1 d " ;
sha256 = " s h a 2 5 6 - R l b N I D R u f 4 s F S 2 z w 4 f I k T u 0 m B 7 x g J f P M D I k 1 I 3 U Y X L k = " ;
2022-04-03 18:54:34 +00:00
} ;
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-04-21 15:54:59 +00:00
mainProgram = " i p f e t c h " ;
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
} ;
}