Added flake.nix

This commit is contained in:
Sebastian 2023-10-25 14:00:01 +02:00
parent 096a1065ea
commit c2ac98421b
3 changed files with 145 additions and 0 deletions

53
default.nix Normal file
View file

@ -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 ];
};
}

61
flake.lock Normal file
View file

@ -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
}

31
flake.nix Normal file
View file

@ -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 { };
}
);
}