nixos/flashprog: Introduce flashprog module

Introduce the flashprog module. By enabling, its udev rules are applied
in addition to installing the package.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
Felix Singer 2025-02-17 23:37:56 +01:00 committed by Bjørn Forsman
parent a5bdd8e8a4
commit 43fccee556
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,28 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.flashprog;
in
{
options.programs.flashprog = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Installs flashprog and configures udev rules for programmers
used by flashprog.
'';
};
package = lib.mkPackageOption pkgs "flashprog" { };
};
config = lib.mkIf cfg.enable {
services.udev.packages = [ cfg.package ];
environment.systemPackages = [ cfg.package ];
};
}