nixpkgs/nixos/modules/programs/k40-whisperer.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
622 B
Nix
Raw Normal View History

2022-02-24 14:15:36 +00:00
{ 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";
2022-02-24 14:15:36 +00:00
group = lib.mkOption {
type = lib.types.str;
2022-02-24 14:15:36 +00:00
description = ''
Group assigned to the device when connected.
'';
default = "k40";
};
package = lib.mkPackageOption pkgs "k40-whisperer" { };
2022-02-24 14:15:36 +00:00
};
config = lib.mkIf cfg.enable {
2022-02-24 14:15:36 +00:00
users.groups.${cfg.group} = {};
environment.systemPackages = [ pkg ];
services.udev.packages = [ pkg ];
};
}