b450903751
GitOrigin-RevId: 74a1793c659d09d7cf738005308b1f86c90cb59b
29 lines
639 B
Nix
29 lines
639 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.hardware.ubertooth;
|
|
|
|
ubertoothPkg = pkgs.ubertooth.override {
|
|
udevGroup = cfg.group;
|
|
};
|
|
in {
|
|
options.hardware.ubertooth = {
|
|
enable = mkEnableOption (lib.mdDoc "Enable the Ubertooth software and its udev rules.");
|
|
|
|
group = mkOption {
|
|
type = types.str;
|
|
default = "ubertooth";
|
|
example = "wheel";
|
|
description = lib.mdDoc "Group for Ubertooth's udev rules.";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = [ ubertoothPkg ];
|
|
|
|
services.udev.packages = [ ubertoothPkg ];
|
|
users.groups.${cfg.group} = {};
|
|
};
|
|
}
|