bba55970ba
GitOrigin-RevId: 3d1a7716d7f1fccbd7d30ab3b2ed3db831f43bde
29 lines
617 B
Nix
29 lines
617 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 "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} = {};
|
|
};
|
|
}
|