Merge pull request #128205 from felixsinger/flashrom/add-udev

flashrom: Install udev-rules file

authored by Martin Weinelt and committed by GitHub c865d036 a3274dca

+43
+8
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
··· 48 48 <link xlink:href="options.html#opt-networking.ucarp.enable">networking.ucarp</link>. 49 49 </para> 50 50 </listitem> 51 + <listitem> 52 + <para> 53 + Users of flashrom should migrate to 54 + <link xlink:href="options.html#opt-programs.flashrom.enable">programs.flashrom.enable</link> 55 + and add themselves to the <literal>flashrom</literal> group to 56 + be able to access programmers supported by flashrom. 57 + </para> 58 + </listitem> 51 59 </itemizedlist> 52 60 </section> 53 61 <section xml:id="sec-release-21.11-incompatibilities">
+2
nixos/doc/manual/release-notes/rl-2111.section.md
··· 16 16 17 17 - [ucarp](https://download.pureftpd.org/pub/ucarp/README), an userspace implementation of the Common Address Redundancy Protocol (CARP). Available as [networking.ucarp](options.html#opt-networking.ucarp.enable). 18 18 19 + - Users of flashrom should migrate to [programs.flashrom.enable](options.html#opt-programs.flashrom.enable) and add themselves to the `flashrom` group to be able to access programmers supported by flashrom. 20 + 19 21 ## Backward Incompatibilities {#sec-release-21.11-incompatibilities} 20 22 21 23 - The `staticjinja` package has been upgraded from 1.0.4 to 2.0.0
+1
nixos/modules/module-list.nix
··· 138 138 ./programs/file-roller.nix 139 139 ./programs/firejail.nix 140 140 ./programs/fish.nix 141 + ./programs/flashrom.nix 141 142 ./programs/flexoptix-app.nix 142 143 ./programs/freetds.nix 143 144 ./programs/fuse.nix
+26
nixos/modules/programs/flashrom.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.programs.flashrom; 7 + in 8 + { 9 + options.programs.flashrom = { 10 + enable = mkOption { 11 + type = types.bool; 12 + default = false; 13 + description = '' 14 + Installs flashrom and configures udev rules for programmers 15 + used by flashrom. Grants access to users in the "flashrom" 16 + group. 17 + ''; 18 + }; 19 + }; 20 + 21 + config = mkIf cfg.enable { 22 + services.udev.packages = [ pkgs.flashrom ]; 23 + environment.systemPackages = [ pkgs.flashrom ]; 24 + users.groups.flashrom = { }; 25 + }; 26 + }
+6
pkgs/tools/misc/flashrom/default.nix
··· 19 19 sha256 = "0ax4kqnh7kd3z120ypgp73qy1knz47l6qxsqzrfkd97mh5cdky71"; 20 20 }; 21 21 22 + postPatch = '' 23 + substituteInPlace util/z60_flashrom.rules \ 24 + --replace "plugdev" "flashrom" 25 + ''; 26 + 22 27 # Meson build doesn't build and install manpage. Only Makefile can. 23 28 # Build manpage from source directory. Here we're inside the ./build subdirectory 24 29 postInstall = '' 25 30 make flashrom.8 -C .. 26 31 installManPage ../flashrom.8 32 + install -Dm644 ../util/z60_flashrom.rules $out/etc/udev/rules.d/flashrom.rules 27 33 ''; 28 34 29 35 mesonFlags = lib.optionals stdenv.isAarch64 [ "-Dpciutils=false" ];