diff --git a/packages.nix b/packages.nix index bac2cbf..3b7bd97 100644 --- a/packages.nix +++ b/packages.nix @@ -13,8 +13,7 @@ let }; in let - atomicptr = import (fetchTarball - "https://github.com/atomicptr/nix/archive/refs/heads/master.tar.gz") { }; + crab = pkgs.callPackage ./pkgs/crab.nix { }; rtk = pkgs.callPackage ./pkgs/rtk.nix { }; in { nixpkgs.overlays = [ pythonOverlay ]; @@ -52,7 +51,7 @@ in { hey ngrok openssl - atomicptr.crab + crab pulseaudioFull pavucontrol diff --git a/pkgs/crab.nix b/pkgs/crab.nix new file mode 100644 index 0000000..89fd711 --- /dev/null +++ b/pkgs/crab.nix @@ -0,0 +1,43 @@ +# Based on https://github.com/atomicptr/nix/blob/master/pkgs/crab/default.nix +# Fixed: removed deprecated `system = system` from mkDerivation +{ + lib, + fetchurl, + installShellFiles, + stdenvNoCC, +}: +let + shaMap = { + x86_64-linux = "18c2mxaf0f01c1905c7ppnq9cq07qr4nn5al9zn9idhzk9b8mf9q"; + x86_64-darwin = "10w9xv7z8fw4628pwnw9dj2n3wf3g0lgfcpy3k2f3v6fhv30abwm"; + }; + urlMap = { + x86_64-linux = "https://github.com/atomicptr/crab/releases/download/v1.4.4/crab_1.4.4_linux_amd64.tar.gz"; + x86_64-darwin = "https://github.com/atomicptr/crab/releases/download/v1.4.4/crab_1.4.4_darwin_amd64.tar.gz"; + }; + system = stdenvNoCC.hostPlatform.system; +in +stdenvNoCC.mkDerivation { + pname = "crab"; + version = "1.4.4"; + src = fetchurl { + url = urlMap.${system}; + sha256 = shaMap.${system}; + }; + sourceRoot = "."; + nativeBuildInputs = [ installShellFiles ]; + installPhase = '' + mkdir -p $out/bin + cp -vr ./crab $out/bin/crab + ''; + meta = { + description = "A versatile tool to crawl dozens of URLs from a given source, like a sitemap or an URL list."; + homepage = "https://github.com/atomicptr/crab"; + license = lib.licenses.mit; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + platforms = [ + "x86_64-darwin" + "x86_64-linux" + ]; + }; +}