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 /nix/schematic.nix | |
| parent | 7f5e8f7d7d467f6dd3321cfa7eb276396a21dc69 (diff) | |
nix: migrate functionality to clef
Diffstat (limited to 'nix/schematic.nix')
| -rw-r--r-- | nix/schematic.nix | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/nix/schematic.nix b/nix/schematic.nix deleted file mode 100644 index acc136f..0000000 --- a/nix/schematic.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ - kicad, - runCommand, - - nix-filter, - lib, - - src, - sch_path, - - schName ? (lib.removeSuffix ".kicad_sch" (builtins.baseNameOf sch_path)), -}: let - sharePath = "share/npry/clef/schematic"; - -in runCommand "${schName}.schematic" { - nativeBuildInputs = [ - kicad - ]; - - src = nix-filter { - root = src; - - include = [ - (nix-filter.matchExt "kicad_sch") - (nix-filter.matchExt "kicad_pro") - ]; - }; -} '' - set -e - export HOME=$(mktemp -d) - - echo "schematic: '${schName}'" >&2 - - mkdir -p "$out/${sharePath}/svg" - cd "$out/${sharePath}" - - kicad-cli sch export pdf -o schematic.pdf $src/${sch_path} - kicad-cli sch export svg -n -o svg $src/${sch_path} - - cd svg - - # normalize - for f in *.svg; do - if [ "$f" = "${schName}.svg" ]; then - mv -nv "$f" "root.svg" - continue - fi - - mv -nv "$f" "''${f#${schName}-}" - done -'' |
