summary refs log tree commit diff
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2025-06-05 03:43:02 +0200
committerMel <mel@rnrd.eu>2025-06-05 03:43:02 +0200
commit1b6875c312bf5a0a2444b8c086a7d12d087511eb (patch)
tree160739c5fb7726faf4e2a7ed5242160eb037b5a2
parent182aa5ecdc5c6583ce9b44c5a13432bb30409fc8 (diff)
downloadminerals-1b6875c312bf5a0a2444b8c086a7d12d087511eb.tar.zst
minerals-1b6875c312bf5a0a2444b8c086a7d12d087511eb.zip
Add general tooling for dealing with hardware and electronics
Signed-off-by: Mel <mel@rnrd.eu>
-rw-r--r--modules/common.nix23
-rw-r--r--modules/electronics.nix60
2 files changed, 69 insertions, 14 deletions
diff --git a/modules/common.nix b/modules/common.nix
index 30fd3ab..28129db 100644
--- a/modules/common.nix
+++ b/modules/common.nix
@@ -1,4 +1,4 @@
-{ me, config, lib, pkgs, unstablePkgs, auxiliaryPkgs, ... }:
+{ me, pkgs, auxiliaryPkgs, ... }:
 
 {
   imports = [
@@ -11,6 +11,7 @@
     ./fonts.nix
     ./flatpak.nix
     ./libreoffice.nix
+    ./electronics.nix
     ./hardware-keys.nix
     ./nix-ld.nix
   ];
@@ -51,17 +52,11 @@
       useRoutingFeatures = "both";
       extraUpFlags = [ "--ssh" ];
     };
-  
+
     # sometimes needed for gnupg
     pcscd.enable = true;
-
-    # packages requiring further udev rules
-    udev.packages = with pkgs; [
-      platformio
-      openocd
-    ];
   };
- 
+
   programs = {
     steam = {
       enable = true;
@@ -72,7 +67,7 @@
     git.enable = true;
 
     adb.enable = true;
-    
+
     gnupg.agent = {
       enable = true;
       enableSSHSupport = true;
@@ -83,7 +78,7 @@
   environment.systemPackages = (with pkgs; [
     file unzip jq dig htop wget screen
     gnupg pinentry-gnome3 age agenix minisign openssl cryptsetup pamtester
-    inetutils pciutils usbutils lshw lsof inxi iw pmutils acpi acpid avrdude
+    inetutils pciutils usbutils lshw lsof inxi iw pmutils acpi acpid
     minicom miniserve netcat-gnu socat tcpdump nmap iftop iperf mtr arp-scan ethtool
     sysprof wireshark mitmproxy hardinfo remmina
     vlc celluloid foliate calibre
@@ -108,16 +103,16 @@
     nodejs_22 deno yarn
     rustc rustup cargo rustfmt
     go gopls delve go-task gotags golangci-lint
-    meson cmake gnumake ninja gdb gcc clang clang-tools openocd
+    meson cmake gnumake ninja gdb gcc clang clang-tools
     hare haredoc
     jdk maven gradle
     nil nixfmt-rfc-style direnv
     nixpkgs-review nixpkgs-fmt nixpkgs-lint-community
     helix alacritty ghostty
-    androidStudioPackages.dev arduino-cli arduino-ide platformio
+    androidStudioPackages.dev
 
     winetricks bottles
-    scrcpy apfs-fuse nfs-utils esp-idf-full
+    scrcpy apfs-fuse nfs-utils
     ubootTools cloud-utils
     borgbackup pika-backup
 
diff --git a/modules/electronics.nix b/modules/electronics.nix
new file mode 100644
index 0000000..9b154b1
--- /dev/null
+++ b/modules/electronics.nix
@@ -0,0 +1,60 @@
+{ pkgs, unstablePkgs, ... }:
+
+let
+  inherit (pkgs) esp-idf-full;
+  inherit (unstablePkgs)
+    freecad
+    kicad
+    qucs-s
+    ngspice
+    librepcb
+    yosys
+    icestorm
+    arduino-cli
+    arduino-ide
+    platformio
+    avrdude
+    openocd
+    ;
+
+  hantek = unstablePkgs.openhantek6022;
+  simulide = unstablePkgs.simulide_1_2_0;
+  nextpnr = unstablePkgs.nextpnrWithGui;
+in
+{
+  # these packages include udev rules for access to their
+  # respective hardware devices.
+  services.udev.packages = [
+    hantek
+    platformio
+    openocd
+  ];
+
+  environment.systemPackages = [
+    # hardware tool support
+    hantek
+
+    # the spice of life!
+    qucs-s
+    ngspice
+    simulide
+    librepcb
+
+    # mostly bearable non-commercial cad software
+    freecad
+    kicad
+
+    # fpga workings
+    nextpnr
+    yosys
+    icestorm
+
+    # platform development tools and frameworks
+    arduino-cli
+    arduino-ide
+    platformio
+    esp-idf-full
+    avrdude
+    openocd
+  ];
+}