2021-04-05 15:23:46 +00:00
|
|
|
{ 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";
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc "Group for Ubertooth's udev rules.";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ ubertoothPkg ];
|
|
|
|
|
|
|
|
services.udev.packages = [ ubertoothPkg ];
|
|
|
|
users.groups.${cfg.group} = {};
|
|
|
|
};
|
|
|
|
}
|