nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit 50dae274bdbdf7b0f7e65b01da3cd99cac01337b
parent 939360d819825cf2c1769d5b63eced9fcacde804
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Sat, 11 Jul 2020 17:55:48 +0300

Add fx

Diffstat:
Mpkgs/default.nix | 1+
Apkgs/tools/text/fx/default.nix | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -106,6 +106,7 @@ lib.makeScope newScope ( elevation = callPackage ./tools/geo/elevation { click = click-6-7; }; + fx = callPackage ./tools/text/fx { }; gimgtools = callPackage ./tools/geo/gimgtools { }; gmaptool = callPackage ./tools/geo/gmaptool { }; gpx-layer = perlPackages.callPackage ./tools/geo/gpx-layer { diff --git a/pkgs/tools/text/fx/default.nix b/pkgs/tools/text/fx/default.nix @@ -0,0 +1,51 @@ +{ stdenv, fetchfromgh, unzip }: +let + pname = "fx"; + version = "18.0.1"; + + inherit (stdenv.hostPlatform) system; + throwSystem = throw "Unsupported system: ${system}"; + + suffix = { + x86_64-linux = "linux"; + x86_64-darwin = "macos"; + }.${system} or throwSystem; +in +stdenv.mkDerivation { + inherit pname version; + + src = fetchfromgh { + inherit version; + owner = "antonmedv"; + repo = "fx"; + name = "fx-${suffix}.zip"; + sha256 = { + x86_64-linux = "1q46qidyg6jmk1f74rp2yaqqpg8yzzrw2vmpm2djyiszsqsakfbz"; + x86_64-darwin = "1mcclxn6hw1b8z47kdp26kybk03b59llfgamp425nni0mi5vzrm0"; + }.${system} or throwSystem; + }; + + dontConfigure = true; + dontBuild = true; + dontStrip = true; + + unpackPhase = "${unzip}/bin/unzip $src"; + + installPhase = "install -Dm755 fx-${suffix} $out/bin/fx"; + + postFixup = with stdenv; lib.optionalString isLinux '' + patchelf \ + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ + --set-rpath "${makeLibraryPath [ stdenv.cc.cc.lib ]}" \ + $out/bin/fx + ''; + + meta = with stdenv.lib; { + description = "Command-line tool and terminal JSON viewer"; + homepage = "https://github.com/antonmedv/fx"; + license = licenses.mit; + maintainers = with maintainers; [ sikmir ]; + platforms = [ "x86_64-linux" "x86_64-darwin" ]; + skip.ci = true; + }; +}