mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
0a37316d6c
This commit replaces a lot of usages of `mkOption` with the package type, to be `mkPackageOption`, in order to reduce the amount of code.
34 lines
730 B
Nix
34 lines
730 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.programs.dmrconfig;
|
|
|
|
in {
|
|
meta.maintainers = with maintainers; [ ];
|
|
|
|
###### interface
|
|
options = {
|
|
programs.dmrconfig = {
|
|
enable = mkOption {
|
|
default = false;
|
|
type = types.bool;
|
|
description = lib.mdDoc ''
|
|
Whether to configure system to enable use of dmrconfig. This
|
|
enables the required udev rules and installs the program.
|
|
'';
|
|
relatedPackages = [ "dmrconfig" ];
|
|
};
|
|
|
|
package = mkPackageOption pkgs "dmrconfig" { };
|
|
};
|
|
};
|
|
|
|
###### implementation
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = [ cfg.package ];
|
|
services.udev.packages = [ cfg.package ];
|
|
};
|
|
}
|