diff options
author | Felix Singer <felixsinger@posteo.net> | 2021-06-26 03:37:52 +0200 |
---|---|---|
committer | Felix Singer <felixsinger@posteo.net> | 2021-06-30 03:43:35 +0200 |
commit | b7a2309786b75989fb31816439f7e52a31cc64b3 (patch) | |
tree | 6602920b3c4ac96b9e4e62601e21501eb49acc39 /nixos/modules | |
parent | e85975942742a3728226ac22a3415f2355bfc897 (diff) | |
download | nixpkgs-b7a2309786b75989fb31816439f7e52a31cc64b3.tar nixpkgs-b7a2309786b75989fb31816439f7e52a31cc64b3.tar.gz nixpkgs-b7a2309786b75989fb31816439f7e52a31cc64b3.tar.bz2 nixpkgs-b7a2309786b75989fb31816439f7e52a31cc64b3.tar.lz nixpkgs-b7a2309786b75989fb31816439f7e52a31cc64b3.tar.xz nixpkgs-b7a2309786b75989fb31816439f7e52a31cc64b3.tar.zst nixpkgs-b7a2309786b75989fb31816439f7e52a31cc64b3.zip |
flashrom: Install udev-rules file
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>
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/flashrom.nix | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 8a96b42c556..a54533f7af1 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -138,6 +138,7 @@ ./programs/file-roller.nix ./programs/firejail.nix ./programs/fish.nix + ./programs/flashrom.nix ./programs/flexoptix-app.nix ./programs/freetds.nix ./programs/fuse.nix diff --git a/nixos/modules/programs/flashrom.nix b/nixos/modules/programs/flashrom.nix new file mode 100644 index 00000000000..f026c2e31cd --- /dev/null +++ b/nixos/modules/programs/flashrom.nix @@ -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 = { }; + }; +} |