From a4337d5830896f0949f74d5f4728e4ecb33f8b93 Mon Sep 17 00:00:00 2001 From: j-moreno-c-r Date: Sat, 14 Feb 2026 14:26:09 -0300 Subject: [PATCH] feat: add flake nix --- .gitignore | 3 ++ flake.lock | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 43 ++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index 0d89f097..7061128b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ compile_commands.json .vscode .clangd +esp-idf/ +.idf-tools/ +.idf-venv/ \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..c2298b80 --- /dev/null +++ b/flake.lock @@ -0,0 +1,96 @@ +{ + "nodes": { + "esp-dev": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1767865407, + "narHash": "sha256-QWF1rZYd+HvNzLIeRS+OEBX7HF0EhWCGeLbMkgtbsIo=", + "owner": "mirrexagon", + "repo": "nixpkgs-esp-dev", + "rev": "5287d6e1ca9e15ebd5113c41b9590c468e1e001b", + "type": "github" + }, + "original": { + "owner": "mirrexagon", + "repo": "nixpkgs-esp-dev", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1767799921, + "narHash": "sha256-r4GVX+FToWVE2My8VVZH4V0pTIpnu2ZE8/Z4uxGEMBE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d351d0653aeb7877273920cd3e823994e7579b0b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1771208521, + "narHash": "sha256-X01Q3DgSpjeBpapoGA4rzKOn25qdKxbPnxHeMLNoHTU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fa56d7d6de78f5a7f997b0ea2bc6efd5868ad9e8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "esp-dev": "esp-dev", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..1c17c139 --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "Kern development shell"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + esp-dev.url = "github:mirrexagon/nixpkgs-esp-dev"; + }; + + outputs = { self, nixpkgs, esp-dev }: + let + system = "x86_64-linux"; + + pkgs = import nixpkgs { inherit system; }; + + espPkgs = import esp-dev.inputs.nixpkgs { + inherit system; + overlays = [ esp-dev.overlays.default ]; + config.permittedInsecurePackages = [ + "python3.12-ecdsa-0.19.1" + "python3.13-ecdsa-0.19.1" + ]; + }; + in + { + devShells.${system}.default = pkgs.mkShell { + name = "esp-idf-shell"; + + buildInputs = [ + pkgs.gcc + pkgs.gnumake + pkgs.just + espPkgs.esp-idf-full + ]; + + shellHook = '' + echo "Kern dev-shell ready" + echo " gcc: $(gcc --version | head -1)" + echo " make: $(make --version | head -1)" + echo " just: $(just --version)" + ''; + }; + }; +} \ No newline at end of file