feat(rust-esp32-c6): make the rust-esp32-c6 template
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
{
|
||||
flake-parts-lib,
|
||||
inputs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
flake = {
|
||||
templates = {
|
||||
rust-esp32-c6 = {
|
||||
path = ./template;
|
||||
description = "ESP32-C6 RISC-V rust project with a blink led example";
|
||||
};
|
||||
};
|
||||
|
||||
flakeModules.rust-esp32-c6 = {
|
||||
imports = [
|
||||
inputs.treefmt-nix.flakeModule
|
||||
self.outputs.flakeModules.rust
|
||||
];
|
||||
|
||||
options.perSystem = flake-parts-lib.mkPerSystemOption ({
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
self',
|
||||
...
|
||||
}: let
|
||||
cfg = config.krantz.rust.esp32-c6;
|
||||
|
||||
craneLib = config.krantz.rust.craneLib;
|
||||
in {
|
||||
options.krantz.rust.esp32-c6 = {
|
||||
enable = lib.mkEnableOption "additional tooling for the esp32 RISC-V";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
krantz.rust.devDeps = lib.mkOptionDefault (with pkgs; [
|
||||
espflash
|
||||
]);
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user