Skip to content

Commit a16691b

Browse files
committed
Refactor source handling in meshcore-packet-capture derivation
1 parent 82af01c commit a16691b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

nix/packages.nix

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,22 @@
3737
meshcore-packet-capture = pkgs.stdenv.mkDerivation {
3838
pname = "meshcore-packet-capture";
3939
version = "1.0.0";
40-
src = ./.;
40+
src = pkgs.lib.cleanSourceWith {
41+
src = ./.;
42+
filter = path: type:
43+
let
44+
baseName = baseNameOf path;
45+
isPythonFile = baseName == "packet_capture.py" ||
46+
baseName == "enums.py" ||
47+
baseName == "auth_token.py" ||
48+
baseName == "ble_pairing_helper.py" ||
49+
baseName == "ble_scan_helper.py" ||
50+
baseName == "scan_meshcore_network.py" ||
51+
baseName == "debug_ble_connection.py" ||
52+
baseName == "migrate_config.py";
53+
in
54+
type == "directory" || isPythonFile;
55+
};
4156

4257
nativeBuildInputs = [pkgs.makeWrapper];
4358

@@ -47,7 +62,7 @@
4762
mkdir -p $out/bin
4863
mkdir -p $out/lib/meshcore-packet-capture
4964
50-
# Copy Python scripts
65+
# Copy Python scripts from source root
5166
cp packet_capture.py $out/lib/meshcore-packet-capture/
5267
cp enums.py $out/lib/meshcore-packet-capture/
5368
cp auth_token.py $out/lib/meshcore-packet-capture/

0 commit comments

Comments
 (0)