3
0
Fork 0
forked from mirrors/nixpkgs

nixos/hardware/ubertooth: init at 2018-12-R1

This commit is contained in:
Alvar Penning 2020-05-13 18:39:36 +02:00
parent 623c10ac79
commit dc0552b0b7
3 changed files with 34 additions and 2 deletions

View file

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

View file

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

View file

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