From 0458e69021f1964e786f01eb77e5727d99127788 Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Wed, 13 May 2020 17:00:56 +0200 Subject: [PATCH 1/5] libbtbb: init at 2018-12-R1 --- .../development/libraries/libbtbb/default.nix | 22 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/libraries/libbtbb/default.nix diff --git a/pkgs/development/libraries/libbtbb/default.nix b/pkgs/development/libraries/libbtbb/default.nix new file mode 100644 index 000000000000..18a656cefdac --- /dev/null +++ b/pkgs/development/libraries/libbtbb/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchFromGitHub, cmake }: + +stdenv.mkDerivation rec { + pname = "libbtbb"; + version = "2018-12-R1"; + + src = fetchFromGitHub { + owner = "greatscottgadgets"; + repo = pname; + rev = version; + sha256 = "07g7yapnbfgm7by8i2ppvx8s66jzha61d1bvm064jb2yi1734ppr"; + }; + + nativeBuildInputs = [ cmake ]; + + meta = with stdenv.lib; { + description = "Bluetooth baseband decoding library"; + homepage = "https://github.com/greatscottgadgets/libbtbb"; + license = licenses.gpl2; + maintainers = with maintainers; [ oxzi ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fa9f0fe1de53..1a682c5d0f64 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4036,6 +4036,8 @@ in libbladeRF = callPackage ../development/libraries/libbladeRF { }; + libbtbb = callPackage ../development/libraries/libbtbb { }; + lp_solve = callPackage ../applications/science/math/lp_solve { }; lprof = callPackage ../tools/graphics/lprof { }; From 623c10ac79fd8cca12d40f182bd1aed87388035d Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Wed, 13 May 2020 18:00:08 +0200 Subject: [PATCH 2/5] ubertooth: init at 2018-12-R1 --- pkgs/applications/radio/ubertooth/default.nix | 32 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/applications/radio/ubertooth/default.nix diff --git a/pkgs/applications/radio/ubertooth/default.nix b/pkgs/applications/radio/ubertooth/default.nix new file mode 100644 index 000000000000..f9626ea4c363 --- /dev/null +++ b/pkgs/applications/radio/ubertooth/default.nix @@ -0,0 +1,32 @@ +{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, libbtbb, libpcap , libusb1, bluez }: + +stdenv.mkDerivation rec { + pname = "ubertooth"; + version = "2018-12-R1"; + + src = fetchFromGitHub { + owner = "greatscottgadgets"; + repo = pname; + rev = version; + sha256 = "1da5fsjwc5szclq6h5wznvgwikd1qqv8gbmv38h0fpc12lwn85c4"; + }; + + sourceRoot = "source/host"; + + nativeBuildInputs = [ cmake pkgconfig ]; + buildInputs = [ libbtbb libpcap libusb1 bluez ]; + + cmakeFlags = lib.optionals stdenv.isLinux [ + "-DINSTALL_UDEV_RULES=TRUE" + "-DUDEV_RULES_PATH=etc/udev/rules.d" + "-DUDEV_RULES_GROUP=ubertooth" + ]; + + meta = with stdenv.lib; { + description = "Open source wireless development platform suitable for Bluetooth experimentation"; + homepage = "https://github.com/greatscottgadgets/ubertooth"; + license = licenses.gpl2; + maintainers = with maintainers; [ oxzi ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1a682c5d0f64..adb020d948b8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8092,6 +8092,8 @@ in ubridge = callPackage ../tools/networking/ubridge { }; + ubertooth = callPackage ../applications/radio/ubertooth { }; + ucl = callPackage ../development/libraries/ucl { }; ucspi-tcp = callPackage ../tools/networking/ucspi-tcp { }; From dc0552b0b7b304e4ff970dd3efd73ebb8381945c Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Wed, 13 May 2020 18:39:36 +0200 Subject: [PATCH 3/5] nixos/hardware/ubertooth: init at 2018-12-R1 --- nixos/modules/hardware/ubertooth.nix | 29 +++++++++++++++++++ nixos/modules/module-list.nix | 1 + pkgs/applications/radio/ubertooth/default.nix | 6 ++-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 nixos/modules/hardware/ubertooth.nix diff --git a/nixos/modules/hardware/ubertooth.nix b/nixos/modules/hardware/ubertooth.nix new file mode 100644 index 000000000000..637fddfb37df --- /dev/null +++ b/nixos/modules/hardware/ubertooth.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.hardware.ubertooth; + + ubertoothPkg = pkgs.ubertooth.override { + udevGroup = cfg.group; + }; +in { + options.hardware.ubertooth = { + enable = mkEnableOption "Enable the Ubertooth software and its udev rules."; + + group = mkOption { + type = types.str; + default = "ubertooth"; + example = "wheel"; + description = "Group for Ubertooth's udev rules."; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ ubertoothPkg ]; + + services.udev.packages = [ ubertoothPkg ]; + users.groups.${cfg.group} = {}; + }; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 8fd5d4519fdd..40665fc1b3e0 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -64,6 +64,7 @@ ./hardware/steam-hardware.nix ./hardware/system-76.nix ./hardware/tuxedo-keyboard.nix + ./hardware/ubertooth.nix ./hardware/usb-wwan.nix ./hardware/onlykey.nix ./hardware/opentabletdriver.nix diff --git a/pkgs/applications/radio/ubertooth/default.nix b/pkgs/applications/radio/ubertooth/default.nix index f9626ea4c363..2ea240618c70 100644 --- a/pkgs/applications/radio/ubertooth/default.nix +++ b/pkgs/applications/radio/ubertooth/default.nix @@ -1,4 +1,6 @@ -{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, libbtbb, libpcap , libusb1, bluez }: +{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, libbtbb, libpcap , libusb1, bluez +, udevGroup ? "ubertooth" +}: stdenv.mkDerivation rec { pname = "ubertooth"; @@ -19,7 +21,7 @@ stdenv.mkDerivation rec { cmakeFlags = lib.optionals stdenv.isLinux [ "-DINSTALL_UDEV_RULES=TRUE" "-DUDEV_RULES_PATH=etc/udev/rules.d" - "-DUDEV_RULES_GROUP=ubertooth" + "-DUDEV_RULES_GROUP=${udevGroup}" ]; meta = with stdenv.lib; { From a1724d186050307cb18baba090a4dade1b17979d Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Fri, 8 Jan 2021 11:27:30 +0100 Subject: [PATCH 4/5] libbtbb: 2018-12-R1 -> 2020-12-R1 --- pkgs/development/libraries/libbtbb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libbtbb/default.nix b/pkgs/development/libraries/libbtbb/default.nix index 18a656cefdac..72d842a55b5d 100644 --- a/pkgs/development/libraries/libbtbb/default.nix +++ b/pkgs/development/libraries/libbtbb/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "libbtbb"; - version = "2018-12-R1"; + version = "2020-12-R1"; src = fetchFromGitHub { owner = "greatscottgadgets"; repo = pname; rev = version; - sha256 = "07g7yapnbfgm7by8i2ppvx8s66jzha61d1bvm064jb2yi1734ppr"; + sha256 = "1byv8174xam7siakr1p0523x97wkh0fmwmq341sd3g70qr2g767d"; }; nativeBuildInputs = [ cmake ]; From 3f2942458880e81f01c6e338fc53d4225e3252a0 Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Fri, 8 Jan 2021 11:27:48 +0100 Subject: [PATCH 5/5] ubertooth: 2018-12-R1 -> 2020-12-R1 --- pkgs/applications/radio/ubertooth/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/radio/ubertooth/default.nix b/pkgs/applications/radio/ubertooth/default.nix index 2ea240618c70..fc9361971e72 100644 --- a/pkgs/applications/radio/ubertooth/default.nix +++ b/pkgs/applications/radio/ubertooth/default.nix @@ -4,13 +4,13 @@ stdenv.mkDerivation rec { pname = "ubertooth"; - version = "2018-12-R1"; + version = "2020-12-R1"; src = fetchFromGitHub { owner = "greatscottgadgets"; repo = pname; rev = version; - sha256 = "1da5fsjwc5szclq6h5wznvgwikd1qqv8gbmv38h0fpc12lwn85c4"; + sha256 = "11r5ag2l5xn4pr7ycicm30w9c3ldn9yiqj1sqnjc79csxl2vrcfw"; }; sourceRoot = "source/host";