Skip to content

Instantly share code, notes, and snippets.

@cjdell
Created July 18, 2024 12:02
Show Gist options
  • Save cjdell/cfb720194eb3ed9573ccdef5bbf1d73b to your computer and use it in GitHub Desktop.
Save cjdell/cfb720194eb3ed9573ccdef5bbf1d73b to your computer and use it in GitHub Desktop.
Raspberry Pi Pico Nix Development Environment Flake
# 1) Install Nix and enable experimental Flakes
# 2) Run with "nix develop"
# 3) Enjoy determinism :-)
{
description = "Raspberry Pi Pico development environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
picoSdk = {
url = "github:raspberrypi/pico-sdk/6a7db34ff63345a7badec79ebea3aaef1712f374";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, picoSdk }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShell = pkgs.mkShell (
{
buildInputs = [
pkgs.cmake
pkgs.gcc-arm-embedded
pkgs.python3
];
shellHook = ''
export PICO_SDK_PATH="${picoSdk}";
export PS1="🤖 \e[35m[Pico Dev]\e[0m:\e[32m\w\e[0m: ";
echo "Welcome to the Raspberry Pi Pico development environment!";
'';
}
);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment