Correct shell usage example
This commit is contained in:
10
README.md
10
README.md
@@ -100,6 +100,12 @@ From the indexes you create overlays which then make the Arduino packages and li
|
|||||||
src = ./. + "/my-esp32-poe-iso-project";
|
src = ./. + "/my-esp32-poe-iso-project";
|
||||||
fqbn = "esp32:esp32:esp32-poe-iso";
|
fqbn = "esp32:esp32:esp32-poe-iso";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
hydraJobs = {
|
||||||
|
# Build binary tarball in CI
|
||||||
|
my-esp32-poe-iso-project = my-esp32-poe-iso-project.binaryTarball;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -108,9 +114,11 @@ From the indexes you create overlays which then make the Arduino packages and li
|
|||||||
## Interactive arduino-cli usage:
|
## Interactive arduino-cli usage:
|
||||||
|
|
||||||
```
|
```
|
||||||
nix develop .#arduinoEnv
|
nix shell .#arduinoEnv
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This adds a wrapped version of `arduino-cli` to your path that reflects you Arduino environment.
|
||||||
|
|
||||||
## Build Arduino Sketch
|
## Build Arduino Sketch
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ let
|
|||||||
inherit fqbn;
|
inherit fqbn;
|
||||||
arduinoSketch = (finalAttrs.finalPackage);
|
arduinoSketch = (finalAttrs.finalPackage);
|
||||||
};
|
};
|
||||||
|
binaryTarball = binaryTarball {
|
||||||
|
inherit name;
|
||||||
|
arduinoSketch = (finalAttrs.finalPackage);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -58,5 +62,18 @@ let
|
|||||||
}: pkgs.writeScriptBin "upload-arduino-sketch" ''
|
}: pkgs.writeScriptBin "upload-arduino-sketch" ''
|
||||||
${arduinoEnv}/bin/arduino-cli upload --log --input-dir=${arduinoSketch} --fqbn=${fqbn} "$@"
|
${arduinoEnv}/bin/arduino-cli upload --log --input-dir=${arduinoSketch} --fqbn=${fqbn} "$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
binaryTarball = {
|
||||||
|
arduinoSketch
|
||||||
|
, name
|
||||||
|
}: pkgs.runCommand "binary-tarball" {} ''
|
||||||
|
mkdir -p $out
|
||||||
|
|
||||||
|
cd ${arduinoSketch}
|
||||||
|
${pkgs.gnutar}/bin/tar -czf $out/${name}.tar.gz *
|
||||||
|
|
||||||
|
mkdir -p $out/nix-support
|
||||||
|
echo "file binary-dist $out/${name}.tar.gz" > $out/nix-support/hydra-build-products
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
mkArduinoEnv
|
mkArduinoEnv
|
||||||
|
|||||||
Reference in New Issue
Block a user