add option to arduino
This commit is contained in:
parent
2ba8b835df
commit
69ab407977
2 changed files with 31 additions and 15 deletions
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# arduino-ide
|
||||
adafruit-nrfutil
|
||||
];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="ttyUSB0", MODE="0666"
|
||||
'';
|
||||
}
|
||||
31
modules/arduino.nix
Normal file
31
modules/arduino.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
|
||||
|
||||
options = {
|
||||
arduinoSetup = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Installs arduino-ide and adafruit-nrfutil and sets udev rules";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.arduino {
|
||||
environment.systemPackages = with pkgs; [
|
||||
arduino-ide
|
||||
adafruit-nrfutil
|
||||
python3 # some arduino libraries require python3
|
||||
];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="ttyUSB[0-9]*",MODE="0666"
|
||||
KERNEL=="ttyACM[0-9]*",MODE="0666"
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue