From 45202d98ec26067f4dce7910194e7edbeb9db3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Wed, 10 Aug 2022 22:43:54 +0200 Subject: [PATCH] Add Arduino module This adds a small arduino development module that installs development tooling and adds the user to the `dialout` group. --- modules/arduino/default.nix | 23 +++++++++++++++++++++++ overlays/overrides.nix | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 modules/arduino/default.nix diff --git a/modules/arduino/default.nix b/modules/arduino/default.nix new file mode 100644 index 0000000..926a0f6 --- /dev/null +++ b/modules/arduino/default.nix @@ -0,0 +1,23 @@ +{ lib, config, pkgs, ... }: +with lib; +let + psCfg = config.pub-solar; + cfg = config.pub-solar.devops; +in +{ + options.pub-solar.arduino = { + enable = mkEnableOption "Life with home automation"; + }; + config = mkIf cfg.enable { + users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] { + extraGroups = [ "dialout" ]; + }; + + home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { + home.packages = [ + arduino + arduino-cli + ]; + }; + }; +} diff --git a/overlays/overrides.nix b/overlays/overrides.nix index 8c016e1..df75736 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -15,6 +15,8 @@ channels: final: prev: { deploy-rs tdesktop + arduino + arduino-cli ;