initial commit
All checks were successful
Deploy docs / build-and-deploy (push) Successful in 3s

This commit is contained in:
sid 2026-02-23 20:34:35 +01:00
commit 95a533c876
451 changed files with 18255 additions and 0 deletions

View file

@ -0,0 +1,103 @@
{
description = "A blink template for ESP32";
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
esp = {
url = "github:mirrexagon/nixpkgs-esp-dev";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
esp,
pre-commit-hooks,
...
}:
let
pname = "blink"; # Also change this in CMakeLists.txt
version = "0.1.0";
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (
system:
import nixpkgs {
inherit system;
overlays = [
self.overlays.default
esp.overlays.default
];
}
);
in
{
overlays.default = final: prev: { };
packages = forAllSystems (system: { });
devShells = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in
{
default = esp.devShells."${system}".default;
}
);
formatter = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
config = self.checks.${system}.pre-commit-check.config;
inherit (config) package configFile;
script = ''
${pkgs.lib.getExe package} run --all-files --config ${configFile}
'';
in
pkgs.writeShellScriptBin "pre-commit-run" script
);
checks = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
flakePkgs = self.packages.${system};
in
{
build-packages = pkgs.linkFarm "flake-packages-${system}" flakePkgs;
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixfmt = {
enable = true;
};
clang-format = {
enable = true;
types_or = nixpkgs.lib.mkForce [
"c"
"cpp"
];
};
};
};
}
);
};
}