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>
This commit is contained in:
parent
e859759427
commit
b7a2309786
@ -48,6 +48,14 @@
|
|||||||
<link xlink:href="options.html#opt-networking.ucarp.enable">networking.ucarp</link>.
|
<link xlink:href="options.html#opt-networking.ucarp.enable">networking.ucarp</link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Users of flashrom should migrate to
|
||||||
|
<link xlink:href="options.html#opt-programs.flashrom.enable">programs.flashrom.enable</link>
|
||||||
|
and add themselves to the <literal>flashrom</literal> group to
|
||||||
|
be able to access programmers supported by flashrom.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
<section xml:id="sec-release-21.11-incompatibilities">
|
<section xml:id="sec-release-21.11-incompatibilities">
|
||||||
|
@ -16,6 +16,8 @@ In addition to numerous new and upgraded packages, this release has the followin
|
|||||||
|
|
||||||
- [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).
|
- [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).
|
||||||
|
|
||||||
|
- 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.
|
||||||
|
|
||||||
## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
|
## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
|
||||||
|
|
||||||
- The `staticjinja` package has been upgraded from 1.0.4 to 2.0.0
|
- The `staticjinja` package has been upgraded from 1.0.4 to 2.0.0
|
||||||
|
@ -138,6 +138,7 @@
|
|||||||
./programs/file-roller.nix
|
./programs/file-roller.nix
|
||||||
./programs/firejail.nix
|
./programs/firejail.nix
|
||||||
./programs/fish.nix
|
./programs/fish.nix
|
||||||
|
./programs/flashrom.nix
|
||||||
./programs/flexoptix-app.nix
|
./programs/flexoptix-app.nix
|
||||||
./programs/freetds.nix
|
./programs/freetds.nix
|
||||||
./programs/fuse.nix
|
./programs/fuse.nix
|
||||||
|
26
nixos/modules/programs/flashrom.nix
Normal file
26
nixos/modules/programs/flashrom.nix
Normal file
@ -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 = { };
|
||||||
|
};
|
||||||
|
}
|
@ -19,11 +19,17 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0ax4kqnh7kd3z120ypgp73qy1knz47l6qxsqzrfkd97mh5cdky71";
|
sha256 = "0ax4kqnh7kd3z120ypgp73qy1knz47l6qxsqzrfkd97mh5cdky71";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace util/z60_flashrom.rules \
|
||||||
|
--replace "plugdev" "flashrom"
|
||||||
|
'';
|
||||||
|
|
||||||
# Meson build doesn't build and install manpage. Only Makefile can.
|
# Meson build doesn't build and install manpage. Only Makefile can.
|
||||||
# Build manpage from source directory. Here we're inside the ./build subdirectory
|
# Build manpage from source directory. Here we're inside the ./build subdirectory
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
make flashrom.8 -C ..
|
make flashrom.8 -C ..
|
||||||
installManPage ../flashrom.8
|
installManPage ../flashrom.8
|
||||||
|
install -Dm644 ../util/z60_flashrom.rules $out/etc/udev/rules.d/flashrom.rules
|
||||||
'';
|
'';
|
||||||
|
|
||||||
mesonFlags = lib.optionals stdenv.isAarch64 [ "-Dpciutils=false" ];
|
mesonFlags = lib.optionals stdenv.isAarch64 [ "-Dpciutils=false" ];
|
||||||
|
Loading…
Reference in New Issue
Block a user