nixpkgs/nixos/modules/programs/flashrom.nix
Jared Baur 53021e3340
nixos/flashrom: Add package option
Allow for custom flashrom package to be used.
2022-11-24 12:31:07 -08:00

27 lines
609 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 = mkPackageOption pkgs "flashrom" { };
};
config = mkIf cfg.enable {
services.udev.packages = [ cfg.package ];
environment.systemPackages = [ cfg.package ];
users.groups.flashrom = { };
};
}