nixos/flashprog: Enable depending NixOS modules (#389346)

This commit is contained in:
Arne Keller 2025-04-26 23:10:07 +02:00 committed by GitHub
commit c632b25205
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -20,6 +20,8 @@ in
config = lib.mkIf cfg.enable {
services.udev.packages = [ cfg.package ];
environment.systemPackages = [ cfg.package ];
hardware.libjaylink.enable = true;
hardware.libftdi.enable = true;
};
meta.maintainers = with lib.maintainers; [ felixsinger ];

View file

@ -46,9 +46,16 @@ stdenv.mkDerivation (finalAttrs: {
libgpiod
];
postPatch = ''
# Remove these rules from flashprog to avoid conflicts with libftdi
sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001"/d' "util/50-flashprog.rules"
sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010"/d' "util/50-flashprog.rules"
sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011"/d' "util/50-flashprog.rules"
sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014"/d' "util/50-flashprog.rules"
'';
postInstall = ''
cd "$src"
install -Dm644 util/50-flashprog.rules "$out/lib/udev/rules.d/50-flashprog.rules"
install -Dm644 ../util/50-flashprog.rules "$out/lib/udev/rules.d/50-flashprog.rules"
'';
passthru.updateScript = gitUpdater {