nixpkgs/pkgs/by-name/ip/ipfetch/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

54 lines
1.4 KiB
Nix

{
stdenv,
lib,
fetchFromGitHub,
bash,
wget,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "ipfetch";
version = "unstable-2024-02-02";
src = fetchFromGitHub {
owner = "trakBan";
repo = "ipfetch";
rev = "09b61e0d1d316dbcfab798dd00bc3f9ceb02431d";
sha256 = "sha256-RlbNIDRuf4sFS2zw4fIkTu0mB7xgJfPMDIk1I3UYXLk=";
};
strictDeps = true;
buildInputs = [
bash
wget
];
nativeBuildInputs = [ makeWrapper ];
postPatch = ''
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 = "Neofetch but for ip addresses";
mainProgram = "ipfetch";
homepage = "https://github.com/trakBan/ipfetch";
license = licenses.gpl3Only;
platforms = platforms.all;
maintainers = with maintainers; [ annaaurora ];
};
}