forked from mirrors/nixpkgs
nixos/hardware/ubertooth: init at 2018-12-R1
This commit is contained in:
parent
623c10ac79
commit
dc0552b0b7
29
nixos/modules/hardware/ubertooth.nix
Normal file
29
nixos/modules/hardware/ubertooth.nix
Normal 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} = {};
|
||||
};
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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; {
|
||||
|
|
Loading…
Reference in a new issue