From 690823d2cd6e0babb833e5a8d8f50af425dbaf34 Mon Sep 17 00:00:00 2001 From: servostar Date: Fri, 22 Dec 2023 14:41:26 +0100 Subject: [PATCH] added arduino module --- dev/arduino.nix | 21 +++++++++++++++++++++ dev/default.nix | 3 ++- settings.nix | 5 ++++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 dev/arduino.nix diff --git a/dev/arduino.nix b/dev/arduino.nix new file mode 100644 index 0000000..60fb698 --- /dev/null +++ b/dev/arduino.nix @@ -0,0 +1,21 @@ +{ pkgs, lib, config, ... }: +let + settings = import ./../settings.nix; +in +{ + config = lib.mkMerge [ + # Arduino IDE 1.x + (lib.mkIf (!settings.dev.arduino.ide2) { + environment.systemPackages = (with pkgs; [ + arduino + ]); + }) + + # Arduino IDE 2.x + (lib.mkIf settings.dev.arduino.ide2 { + environment.systemPackages = (with pkgs; [ + arduino-ide + ]); + }) + ]; +} diff --git a/dev/default.nix b/dev/default.nix index 0b85135..22c452c 100644 --- a/dev/default.nix +++ b/dev/default.nix @@ -11,5 +11,6 @@ in ++ lib.optionals settings.dev.dotnet [ ./dotnet.nix ] ++ lib.optionals settings.dev.python3.enable [ ./python3.nix ] ++ lib.optionals settings.virtualisation.waydroid [ ./waydroid.nix ] - ++ lib.optionals settings.virtualisation.wine.enable [ ./wine.nix ]; + ++ lib.optionals settings.virtualisation.wine.enable [ ./wine.nix ] + ++ lib.optionals settings.dev.arduino.enable [ ./arduino.nix ]; } diff --git a/settings.nix b/settings.nix index 59283b2..3156f15 100644 --- a/settings.nix +++ b/settings.nix @@ -70,7 +70,10 @@ with import {}; scipy ]; }; - + arduino = { + enable = false; # enable arduino development platform + ide2 = true; # wether to use IDE 2.x or deprecated 1.x + }; lsp = { enable = true; # various language server