aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2024-08-14 03:52:50 -0400
committerNathan Perry <np@nathanperry.dev>2024-08-14 03:52:50 -0400
commit64c25cff1e7b47e67be8652386b2c9df1ddb49f3 (patch)
tree1658ba9d7cdf0c3dfee9988a9a8bd5a8daec3093
parentdd0b5c571fc4a26864e29658cafd42bdbbc4848d (diff)
nix/schematic: work in src to find local wks files
-rw-r--r--clef/nix/schematic.nix11
-rw-r--r--flake.lock2
2 files changed, 8 insertions, 5 deletions
diff --git a/clef/nix/schematic.nix b/clef/nix/schematic.nix
index acc136f..e931dd4 100644
--- a/clef/nix/schematic.nix
+++ b/clef/nix/schematic.nix
@@ -23,6 +23,9 @@ in runCommand "${schName}.schematic" {
include = [
(nix-filter.matchExt "kicad_sch")
(nix-filter.matchExt "kicad_pro")
+ (nix-filter.matchExt "kicad_wks")
+
+ (_args: path: type: type == "directory")
];
};
} ''
@@ -32,12 +35,12 @@ in runCommand "${schName}.schematic" {
echo "schematic: '${schName}'" >&2
mkdir -p "$out/${sharePath}/svg"
- cd "$out/${sharePath}"
+ cd "$src"
- kicad-cli sch export pdf -o schematic.pdf $src/${sch_path}
- kicad-cli sch export svg -n -o svg $src/${sch_path}
+ kicad-cli sch export pdf -o "$out/${sharePath}/schematic.pdf" $src/${sch_path}
+ kicad-cli sch export svg -n -o "$out/${sharePath}/svg" $src/${sch_path}
- cd svg
+ cd "$out/${sharePath}/svg"
# normalize
for f in *.svg; do
diff --git a/flake.lock b/flake.lock
index 62abf7c..2785693 100644
--- a/flake.lock
+++ b/flake.lock
@@ -30,7 +30,7 @@
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-keX8wAIShSwyQpzHeMpzYf4Edqn4XddHu6QvVFrG/3g=",
+ "narHash": "sha256-pkNrmtKW8t9a0kcBS7aoSoo3dk7+YO1roIQJvsnO8mQ=",
"path": "./clef",
"type": "path"
},