53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{
|
|
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
|
|
]);
|
|
|
|
krantz.rust.cargoArtifacts.extraAttrs = lib.mkOptionDefault {
|
|
doCheck = false;
|
|
};
|
|
|
|
krantz.rust.package.extraAttrs = lib.mkOptionDefault {
|
|
doCheck = false;
|
|
};
|
|
};
|
|
});
|
|
};
|
|
};
|
|
}
|