mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
31 lines
622 B
Nix
31 lines
622 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.programs.k40-whisperer;
|
|
pkg = cfg.package.override {
|
|
udevGroup = cfg.group;
|
|
};
|
|
in
|
|
{
|
|
options.programs.k40-whisperer = {
|
|
enable = lib.mkEnableOption "K40-Whisperer";
|
|
|
|
group = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = ''
|
|
Group assigned to the device when connected.
|
|
'';
|
|
default = "k40";
|
|
};
|
|
|
|
package = lib.mkPackageOption pkgs "k40-whisperer" { };
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
users.groups.${cfg.group} = {};
|
|
|
|
environment.systemPackages = [ pkg ];
|
|
services.udev.packages = [ pkg ];
|
|
};
|
|
}
|