mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 20:03:16 +00:00
9da5f12ecf
another transitional option factory, like mkAliasOptionModuleMD.
28 lines
611 B
Nix
28 lines
611 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.programs.flashrom;
|
|
in
|
|
{
|
|
options.programs.flashrom = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = lib.mdDoc ''
|
|
Installs flashrom and configures udev rules for programmers
|
|
used by flashrom. Grants access to users in the "flashrom"
|
|
group.
|
|
'';
|
|
};
|
|
package = mkPackageOptionMD pkgs "flashrom" { };
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.udev.packages = [ cfg.package ];
|
|
environment.systemPackages = [ cfg.package ];
|
|
users.groups.flashrom = { };
|
|
};
|
|
}
|