2022-02-24 15:15:36 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.k40-whisperer;
|
|
|
|
pkg = cfg.package.override {
|
|
|
|
udevGroup = cfg.group;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.programs.k40-whisperer = {
|
2022-08-28 21:18:44 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc "K40-Whisperer");
|
2022-02-24 15:15:36 +01:00
|
|
|
|
|
|
|
group = mkOption {
|
|
|
|
type = types.str;
|
2022-07-28 23:19:15 +02:00
|
|
|
description = lib.mdDoc ''
|
2022-02-24 15:15:36 +01:00
|
|
|
Group assigned to the device when connected.
|
|
|
|
'';
|
|
|
|
default = "k40";
|
|
|
|
};
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.k40-whisperer;
|
|
|
|
defaultText = literalExpression "pkgs.k40-whisperer";
|
|
|
|
example = literalExpression "pkgs.k40-whisperer";
|
2022-07-28 23:19:15 +02:00
|
|
|
description = lib.mdDoc ''
|
2022-02-24 15:15:36 +01:00
|
|
|
K40 Whisperer package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
users.groups.${cfg.group} = {};
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkg ];
|
|
|
|
services.udev.packages = [ pkg ];
|
|
|
|
};
|
|
|
|
}
|