commit d1ec1fd689517ab55127cc44baaf42342ae312fe Author: Filipriec Date: Sun Sep 28 23:58:14 2025 +0200 init nix flake commit diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d9bd508 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1758690382, + "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e643668fd71b949c53f8626614b21ff71a07379d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..600664a --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "ESP32-D0WD-V3 (esp32-hal) Rust dev flake"; + + inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; + + outputs = { self, nixpkgs }: let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in { + devShells.${system}.default = pkgs.mkShell { + packages = with pkgs; [ + llvm + cmake + ninja + python3 + pkg-config + git + curl + wget + unzip + gcc + gnumake + rustup + cargo-espflash + espup + ]; + + shellHook = '' + echo ">>> ESP32 DevShell (esp-hal only)" + + if [ ! -d "$HOME/.espup" ]; then + echo "Running espup install..." + espup install + fi + + # Activate Xtensa Rust toolchain + export RUSTUP_TOOLCHAIN=esp + export PATH=$HOME/.rustup/toolchains/esp/bin:$PATH + + echo "Xtensa Rust toolchain ready." + rustc --version + ''; + }; + }; +}