diff options
| author | Nathan Perry <np@nathanperry.dev> | 2024-08-14 01:34:16 -0400 |
|---|---|---|
| committer | Nathan Perry <np@nathanperry.dev> | 2024-08-14 03:29:44 -0400 |
| commit | a330a1fad3c1ccdd926297747c03fe95bcaa6587 (patch) | |
| tree | a8d7ccdfd0ac1d420b4346ad9c0badaf2d31868d /clef/nix/board.nix | |
| parent | 7f5e8f7d7d467f6dd3321cfa7eb276396a21dc69 (diff) | |
nix: migrate functionality to clef
Diffstat (limited to 'clef/nix/board.nix')
| -rw-r--r-- | clef/nix/board.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/clef/nix/board.nix b/clef/nix/board.nix new file mode 100644 index 0000000..d67417b --- /dev/null +++ b/clef/nix/board.nix @@ -0,0 +1,37 @@ +{ + runCommand, + + svg, + model, + fabrication, + schematic, + panel, + panelSrc, + + 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" ./ + + ${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; + fab = fabrication; + }; +}) |
