mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +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.
30 lines
583 B
Nix
30 lines
583 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.hardware.digitalbitbox;
|
|
in
|
|
|
|
{
|
|
options.hardware.digitalbitbox = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = lib.mdDoc ''
|
|
Enables udev rules for Digital Bitbox devices.
|
|
'';
|
|
};
|
|
|
|
package = mkPackageOption pkgs "digitalbitbox" {
|
|
extraDescription = ''
|
|
This can be used to install a package with udev rules that differ from the defaults.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.udev.packages = [ cfg.package ];
|
|
};
|
|
}
|