diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 270357953b..20a41d0c77 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -73,4 +73,5 @@ authentik = import ./authentik args; flipperzero-firmware = import ./flipperzero-firmware args; jj = import ./jj.nix args; + readsb = pkgs.callPackage ./readsb { }; } // (import ./heptapod-runner args) diff --git a/nix/pkgs/readsb/default.nix b/nix/pkgs/readsb/default.nix new file mode 100644 index 0000000000..8997ace830 --- /dev/null +++ b/nix/pkgs/readsb/default.nix @@ -0,0 +1,56 @@ +{ lib +, fetchFromGitHub +, stdenv +, libusb1 +, ncurses +, zlib +, zstd + +, librtlsdr +, libbladeRF +, libiio +, libad9361 + +, pkg-config +}: + +stdenv.mkDerivation rec { + pname = "readsb"; + version = "3.14.1595"; + + src = fetchFromGitHub { + owner = "wiedehopf"; + repo = "readsb"; + rev = "v${version}"; + sha256 = "sha256:1ws8fphlgghcp8v1p88gjpwmy3sf0sypdwzcaai19a882jll486n"; + }; + + buildInputs = [ + libusb1 + ncurses + zlib + zstd + + librtlsdr + libbladeRF + libiio + libad9361 + ]; + + nativeBuildInputs = [ + pkg-config + ]; + + makeFlags = "RTLSDR=yes AIRCRAFT_HASH_BITS=15 HISTORY=yes BLADERF=yes PLUTOSDR=yes AGGRESSIVE=yes HAVE_BIASTEE=yes"; + enableParallelBuilding = true; + + installPhase = '' + runHook preInstall + + install -d $out/bin + install -m 0755 readsb $out/bin/readsb + ln -s $out/bin/readsb $out/bin/viewadsb + + runHook postInstall + ''; +}