Add the udev-rules file from flashrom source to the out directory. The file contains rules for programmers used by flashrom. Members of the `flashrom` system group are allowed to access these devices. Also, add a module for installing flashrom and adding flashrom to udev packages. The module can be used by setting `programs.flashrom.enable` to `true`. Signed-off-by: Felix Singer <felixsinger@posteo.net>launchpad/nixpkgs/master
parent
e859759427
commit
b7a2309786
@ -0,0 +1,26 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
cfg = config.programs.flashrom; |
||||
in |
||||
{ |
||||
options.programs.flashrom = { |
||||
enable = mkOption { |
||||
type = types.bool; |
||||
default = false; |
||||
description = '' |
||||
Installs flashrom and configures udev rules for programmers |
||||
used by flashrom. Grants access to users in the "flashrom" |
||||
group. |
||||
''; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
services.udev.packages = [ pkgs.flashrom ]; |
||||
environment.systemPackages = [ pkgs.flashrom ]; |
||||
users.groups.flashrom = { }; |
||||
}; |
||||
} |
Loading…
Reference in new issue