about summary refs log tree commit diff
path: root/nixos/modules/programs/dmrconfig.nix
blob: 0078ca19f41a17bbdd99597f24c64bbac4f95f77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ config, lib, pkgs, ... }:

let
  cfg = config.programs.dmrconfig;

in {
  meta.maintainers = with lib.maintainers; [ ];

  ###### interface
  options = {
    programs.dmrconfig = {
      enable = lib.mkOption {
        default = false;
        type = lib.types.bool;
        description = ''
          Whether to configure system to enable use of dmrconfig. This
          enables the required udev rules and installs the program.
        '';
        relatedPackages = [ "dmrconfig" ];
      };

      package = lib.mkPackageOption pkgs "dmrconfig" { };
    };
  };

  ###### implementation
  config = lib.mkIf cfg.enable {
    environment.systemPackages = [ cfg.package ];
    services.udev.packages = [ cfg.package ];
  };
}