depot/third_party/nixpkgs/nixos/modules/programs/k40-whisperer.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

32 lines
635 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.k40-whisperer;
pkg = cfg.package.override {
udevGroup = cfg.group;
};
in
{
options.programs.k40-whisperer = {
enable = mkEnableOption (lib.mdDoc "K40-Whisperer");
group = mkOption {
type = types.str;
description = lib.mdDoc ''
Group assigned to the device when connected.
'';
default = "k40";
};
package = mkPackageOption pkgs "k40-whisperer" { };
};
config = mkIf cfg.enable {
users.groups.${cfg.group} = {};
environment.systemPackages = [ pkg ];
services.udev.packages = [ pkg ];
};
}