depot/third_party/nixpkgs/nixos/modules/programs/k40-whisperer.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

30 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 ];
};
}