1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00
nixpkgs/nixos/modules/hardware/ubertooth.nix
2022-11-10 09:30:00 +01:00

30 lines
627 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 "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} = {};
};
}