From d8fd45187ee1dd80223e95249cddc46f15c87f92 Mon Sep 17 00:00:00 2001
From: Felix Tenley <dev@felschr.com>
Date: Mon, 21 Oct 2019 16:55:37 +0200
Subject: [PATCH] add Planck EZ udev rules

---
 common/planck.nix | 10 ++++++++++
 home-pc.nix       |  1 +
 work-pc.nix       |  1 +
 3 files changed, 12 insertions(+)
 create mode 100644 common/planck.nix

diff --git a/common/planck.nix b/common/planck.nix
new file mode 100644
index 0000000..9ca387d
--- /dev/null
+++ b/common/planck.nix
@@ -0,0 +1,10 @@
+{ config, pkgs, ... }:
+
+{
+  services.udev.extraRules = ''
+    # STM32 rules for the Planck EZ Standard / Glow
+    SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", \
+        MODE:="0666", \
+        SYMLINK+="stm32_dfu"
+  '';
+}
diff --git a/home-pc.nix b/home-pc.nix
index 01c8f2e..32c8da6 100644
--- a/home-pc.nix
+++ b/home-pc.nix
@@ -12,6 +12,7 @@ in
     ./common/base-hardware.nix
     ./common/gpu-nvidia.nix
     ./common/ledger.nix
+    ./common/planck.nix
     ./common/system.nix
     ./common/nix.nix
     ./common/i18n.nix
diff --git a/work-pc.nix b/work-pc.nix
index b923b92..4c9b2fa 100644
--- a/work-pc.nix
+++ b/work-pc.nix
@@ -11,6 +11,7 @@ in
     <home-manager/nixos>
     ./common/base-hardware.nix
     ./common/gpu-bumblebee.nix
+    ./common/planck.nix
     ./common/system.nix
     ./common/nix.nix
     ./common/i18n.nix