2021-06-26 04:37:52 +03:00
|
|
|
{ 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.
|
|
|
|
'';
|
|
|
|
};
|
2022-12-30 23:04:52 +03:00
|
|
|
package = mkPackageOptionMD pkgs "flashrom" { };
|
2021-06-26 04:37:52 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-11-24 23:31:07 +03:00
|
|
|
services.udev.packages = [ cfg.package ];
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
2021-06-26 04:37:52 +03:00
|
|
|
};
|
|
|
|
}
|