mirror of
https://github.com/kittywitch/esp32-c3-meepy.git
synced 2026-02-09 07:59:18 -08:00
69 lines
2 KiB
Nix
69 lines
2 KiB
Nix
{
|
|
inputs = {
|
|
esp-rs-nix = {
|
|
url = "github:leighleighleigh/esp-rs-nix";
|
|
};
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
};
|
|
outputs = { nixpkgs, flake-utils, esp-rs-nix, ... }@inputs: let
|
|
mkPkgs = system: (import nixpkgs) {
|
|
inherit system;
|
|
rust.rustcTarget = "riscv32imc-unknown-none-elf";
|
|
};
|
|
eachSystemOutputs = flake-utils.lib.eachDefaultSystem (system: let
|
|
pkgs = mkPkgs system;
|
|
inherit (esp-rs-nix.packages.${system}) esp-rs;
|
|
esp-shell = pkgs.mkShell rec {
|
|
name = "esp-shell";
|
|
|
|
buildInputs = [
|
|
esp-rs
|
|
pkgs.rustup
|
|
pkgs.espflash
|
|
pkgs.pkg-config
|
|
pkgs.stdenv.cc
|
|
#pkgs.rust-analyzer
|
|
#pkgs.bacon
|
|
#pkgs.systemdMinimal
|
|
#pkgs.lunarvim
|
|
#pkgs.inotify-tools
|
|
#pkgs.picocom
|
|
#pkgs.vscode-fhs
|
|
pkgs.libusb1
|
|
pkgs.python3
|
|
# Workspace command runners
|
|
pkgs.just
|
|
pkgs.mprocs
|
|
# This is for parameterising the justfile
|
|
pkgs.toml-cli
|
|
pkgs.moreutils
|
|
pkgs.gdb
|
|
];
|
|
|
|
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}";
|
|
|
|
shellHook = ''
|
|
# custom bashrc stuff
|
|
export PS1_PREFIX="(esp-rs)"
|
|
. ~/.bashrc
|
|
|
|
export LD_LIBRARY_PATH="''${LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
|
|
# this is important - it tells rustup where to find the esp toolchain,
|
|
# without needing to copy it into your local ~/.rustup/ folder.
|
|
export RUSTUP_TOOLCHAIN=${esp-rs}
|
|
|
|
# Load shell completions for espflash
|
|
if (which espflash >/dev/null 2>&1); then
|
|
. <(espflash completions $(basename $SHELL))
|
|
fi
|
|
'';
|
|
};
|
|
in {
|
|
devShells = {
|
|
inherit esp-shell;
|
|
default = esp-shell;
|
|
};
|
|
});
|
|
in eachSystemOutputs;
|
|
}
|