aboutsummaryrefslogtreecommitdiff
path: root/hw/clef/nix/board.nix
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2024-09-02 19:53:43 -0400
committerNathan Perry <np@nathanperry.dev>2024-09-02 19:53:43 -0400
commit982798292719a24bcbb4f9e17cd5c65c8a46ecda (patch)
tree11800fcb5a70f21903aeebed407473420bbe0d41 /hw/clef/nix/board.nix
parent5ddfa32166cee8b2f91f37f9037eb26c182c2125 (diff)
move hw into subdirectory
Diffstat (limited to 'hw/clef/nix/board.nix')
-rw-r--r--hw/clef/nix/board.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/hw/clef/nix/board.nix b/hw/clef/nix/board.nix
new file mode 100644
index 0000000..5de46e0
--- /dev/null
+++ b/hw/clef/nix/board.nix
@@ -0,0 +1,39 @@
+{
+ runCommand,
+
+ svg,
+ model,
+ fabrication,
+ schematic,
+ panel,
+ panelSrc,
+ bom,
+
+ name,
+ outPath,
+}: let
+ pkg = runCommand name {} ''
+ set -e
+
+ mkdir -p "$out/${outPath}"
+ cd "$out/${outPath}"
+
+ echo "populating $(pwd)"
+
+ cp --reflink=auto -vr "${schematic}/share/npry/clef/schematic" ./
+ cp --reflink=auto -vr "${svg}/share/npry/clef/svg" ./
+ cp --reflink=auto -vr "${fabrication}/share/npry/clef/fab" ./
+ cp --reflink=auto -vr "${model}/share/npry/clef/model" ./
+ cp --reflink=auto -vr "${bom}/share/npry/clef/bom" ./
+
+ ${if panelSrc != null then ''
+ cp --reflink=auto -vr "${panelSrc}/share/npry/clef/panel" ./
+ '' else ""}
+ '';
+
+in pkg.overrideAttrs (prevAttrs: {
+ passthru = (prevAttrs.passthru or {}) // {
+ inherit schematic fabrication svg model panel panelSrc bom;
+ fab = fabrication;
+ };
+})