software/minipro: add minipro setup
This commit is contained in:
parent
ec0c96fa0f
commit
fe3d66a21d
2 changed files with 40 additions and 0 deletions
37
modules/modules/software/minipro.nix
Normal file
37
modules/modules/software/minipro.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
with lib.hlissner;
|
||||
let
|
||||
cfg = config.modules.software.minipro;
|
||||
in
|
||||
{
|
||||
options.modules.software.minipro = {
|
||||
enable = mkBoolOpt false;
|
||||
udev = mkBoolOpt true;
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home.home.packages = with pkgs; [ minipro ];
|
||||
|
||||
# https://gitlab.com/DavidGriffith/minipro/-/tree/master/udev
|
||||
services.udev.extraRules = mkIf cfg.udev ''
|
||||
ACTION!="add|change", GOTO="minipro_rules_end"
|
||||
SUBSYSTEM!="usb", GOTO="minipro_rules_end"
|
||||
|
||||
# TL866A/CS
|
||||
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="e11c", ENV{ID_MINIPRO}="1"
|
||||
|
||||
# TL866II+
|
||||
ATTRS{idVendor}=="a466", ATTRS{idProduct}=="0a53", ENV{ID_MINIPRO}="1"
|
||||
|
||||
LABEL="minipro_rules_end"
|
||||
|
||||
ACTION!="add|change", GOTO="minipro_rules_plugdev_end"
|
||||
ENV{ID_MINIPRO}=="1", MODE="660", GROUP="plugdev"
|
||||
LABEL="minipro_rules_plugdev_end"
|
||||
|
||||
ACTION!="add|change", GOTO="minipro_rules_uaccess_end"
|
||||
ENV{ID_MINIPRO}=="1", TAG+="uaccess"
|
||||
LABEL="minipro_rules_uaccess_end"
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -97,6 +97,8 @@ in
|
|||
monospace = [ "DejaVuSansMono" ];
|
||||
};
|
||||
};
|
||||
|
||||
software.minipro.enable = true;
|
||||
};
|
||||
|
||||
user = {
|
||||
|
@ -114,6 +116,7 @@ in
|
|||
"libvirtd"
|
||||
"minecraft"
|
||||
"wheel"
|
||||
"plugdev"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue