diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..a955828 --- /dev/null +++ b/default.nix @@ -0,0 +1,53 @@ +{ lib +, stdenv +, fetchFromGitHub +, pkg-config +, libbladeRF +, libusb1 +, ncurses +, rtl-sdr +, hackrf +, limesuite +}: + +stdenv.mkDerivation rec { + pname = "dump1090-afg"; + version = "1.0"; + + src = ./.; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ + libbladeRF + libusb1 + ncurses + rtl-sdr + hackrf + ] ++ lib.optional stdenv.isLinux limesuite; + + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang + "-Wno-implicit-function-declaration -Wno-int-conversion"; + + buildFlags = [ "dump1090" ]; + + doCheck = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin $out/share + cp -v dump1090 $out/bin/dump1090-afg + cp -vr public_html $out/share/dump1090 + + runHook postInstall + ''; + + meta = with lib; { + description = "A simple Mode S decoder for RTLSDR devices with patches for DL0XK"; + homepage = "https://bierauflauf.unix-ag.uni-kl.de/AFG/dump1090"; + license = licenses.gpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ earldouglas ]; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..bd98bc3 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1685566663, + "narHash": "sha256-btHN1czJ6rzteeCuE/PNrdssqYD2nIA4w48miQAFloM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4ecab3273592f27479a583fb6d975d4aba3486fe", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b5d2810 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "A flake for dump1090 with DL0XK patches."; + + inputs = { + # Pointing to the current stable release of nixpkgs. You can + # customize this to point to an older version or unstable if you + # like everything shining. + # + # E.g. + # + # nixpkgs.url = "github:NixOS/nixpkgs/unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/23.05"; + + utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, utils }: + utils.lib.eachDefaultSystem + (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + + formatter = pkgs.nixpkgs-fmt; + + defaultPackage = pkgs.callPackage ./default.nix { }; + } + ); + +}