aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/module.nix14
-rw-r--r--nix/wchisp.nix26
2 files changed, 40 insertions, 0 deletions
diff --git a/nix/module.nix b/nix/module.nix
new file mode 100644
index 0000000..73f4d4c
--- /dev/null
+++ b/nix/module.nix
@@ -0,0 +1,14 @@
+{ config, lib, ... }:
+
+{
+ options.hardware.numini-dev.enable = lib.mkEnableOption "numini-dev";
+
+ config = lib.mkIf config.hardware.numini-dev.enable {
+ services.udev.extraRules = ''
+ # CH559
+ ATTRS{idVendor}=="4348", ATTRS{idProduct}=="55e0", GROUP="users"
+ # iCEBreaker
+ ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", GROUP="users"
+ '';
+ };
+}
diff --git a/nix/wchisp.nix b/nix/wchisp.nix
new file mode 100644
index 0000000..6d6b4eb
--- /dev/null
+++ b/nix/wchisp.nix
@@ -0,0 +1,26 @@
+{
+ fetchFromGitHub,
+ lib,
+ rustPlatform,
+}:
+
+rustPlatform.buildRustPackage {
+ pname = "wchisp";
+ version = "0.3.0";
+
+ src = fetchFromGitHub {
+ owner = "ch32-rs";
+ repo = "wchisp";
+ rev = "v0.3.0";
+ hash = "sha256-CCZA+VegdNq9yYqN2ZI2vmI1OOtCcsYeKK6+VdvW2FE=";
+ };
+
+ cargoHash = "sha256-5kJ0MK0rUzyJvLZH/3nje+gTAM6et0mNE3sxVoK1L5s=";
+
+ meta = {
+ description = "WCH ISP Tool in Rust";
+ homepage = "https://github.com/ch32-rs/wchisp";
+ license = lib.licenses.gpl2Only;
+ maintainers = [ lib.maintainers.remexre ];
+ };
+}