1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8let
9 cfg = config.hardware.kryoflux;
10
11in
12{
13 options.hardware.kryoflux = {
14 enable = lib.mkOption {
15 type = lib.types.bool;
16 default = false;
17 description = ''
18 Enables kryoflux udev rules, ensures 'floppy' group exists. This is a
19 prerequisite to using devices supported by kryoflux without being root,
20 since kryoflux device descriptors will be owned by floppy through udev.
21 '';
22 };
23 package = lib.mkPackageOption pkgs "kryoflux" { };
24 };
25
26 config = lib.mkIf cfg.enable {
27 services.udev.packages = [ cfg.package ];
28 environment.systemPackages = [ cfg.package ];
29 users.groups.floppy = { };
30 };
31
32 meta.maintainers = with lib.maintainers; [ matthewcroughan ];
33}