2020-05-13 16:39:36 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.hardware.ubertooth;
|
|
|
|
|
|
|
|
ubertoothPkg = pkgs.ubertooth.override {
|
|
|
|
udevGroup = cfg.group;
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
options.hardware.ubertooth = {
|
2022-11-09 21:45:00 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "Ubertooth software and its udev rules");
|
2020-05-13 16:39:36 +00:00
|
|
|
|
|
|
|
group = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "ubertooth";
|
|
|
|
example = "wheel";
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc "Group for Ubertooth's udev rules.";
|
2020-05-13 16:39:36 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ ubertoothPkg ];
|
|
|
|
|
|
|
|
services.udev.packages = [ ubertoothPkg ];
|
|
|
|
users.groups.${cfg.group} = {};
|
|
|
|
};
|
|
|
|
}
|