depot/nixos/modules/programs/k40-whisperer.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00: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 ];
};
}