2021-04-05 15:23:46 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.hardware.ubertooth;
|
|
|
|
|
|
|
|
ubertoothPkg = pkgs.ubertooth.override {
|
|
|
|
udevGroup = cfg.group;
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
options.hardware.ubertooth = {
|
2024-09-19 14:19:46 +00:00
|
|
|
enable = lib.mkEnableOption "Ubertooth software and its udev rules";
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
group = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
2021-04-05 15:23:46 +00:00
|
|
|
default = "ubertooth";
|
|
|
|
example = "wheel";
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Group for Ubertooth's udev rules.";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2021-04-05 15:23:46 +00:00
|
|
|
environment.systemPackages = [ ubertoothPkg ];
|
|
|
|
|
|
|
|
services.udev.packages = [ ubertoothPkg ];
|
|
|
|
users.groups.${cfg.group} = {};
|
|
|
|
};
|
|
|
|
}
|