Correct shell usage example

This commit is contained in:
2023-12-03 18:20:06 +01:00
parent 2263f20c42
commit fbdd609c0d
2 changed files with 26 additions and 1 deletions

View File

@@ -100,6 +100,12 @@ From the indexes you create overlays which then make the Arduino packages and li
src = ./. + "/my-esp32-poe-iso-project";
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:
```
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
```

View File

@@ -49,6 +49,10 @@ let
inherit fqbn;
arduinoSketch = (finalAttrs.finalPackage);
};
binaryTarball = binaryTarball {
inherit name;
arduinoSketch = (finalAttrs.finalPackage);
};
};
});
@@ -58,5 +62,18 @@ let
}: pkgs.writeScriptBin "upload-arduino-sketch" ''
${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
mkArduinoEnv