play/flake.nix

70 lines
2.2 KiB
Nix
Raw Normal View History

2023-11-12 22:27:50 +00:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
artemist-packages = {
url = "git+https://git.mildlyfunctional.gay/artemist/packages.git";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "utils";
};
2024-03-24 20:54:34 +00:00
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "utils";
};
2023-11-12 22:27:50 +00:00
};
2024-03-24 20:54:34 +00:00
outputs = { self, nixpkgs, utils, artemist-packages, rust-overlay }:
2023-11-12 22:27:50 +00:00
utils.lib.eachDefaultSystem (system:
2024-03-24 20:54:34 +00:00
let
pkgs = import nixpkgs {
inherit system;
overlays = [
artemist-packages.overlays.default
rust-overlay.overlays.default
];
};
2024-02-23 05:45:11 +00:00
in rec {
2023-11-12 22:27:50 +00:00
devShells.zephyr =
artemist-packages.devShells.${system}.zephyr.override {
2024-03-24 20:54:34 +00:00
toolchains = with pkgs.zephyrPackages.toolchains; [
arm-zephyr-eabi
riscv64-zephyr-elf
];
modules = with pkgs.zephyrPackages.modules; [
mbedtls
hal_rpi_pico
hal_atmel
cmsis
];
2024-02-04 02:38:44 +00:00
extraPackages = with pkgs; [ pyocd ];
2023-11-12 22:27:50 +00:00
};
2024-02-23 05:45:11 +00:00
devShells.zephyr-west = devShells.zephyr.override {
enableWest = true;
zephyrSrc = null;
modules = [ ];
};
2024-03-24 20:54:34 +00:00
devShells.rust-embedded = let
rust = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "llvm-tools-preview" "clippy" ];
# just use all of them, why not
targets = [
"thumbv6m-none-eabi"
"thumbv7m-none-eabi"
"thumbv7em-none-eabi"
"thumbv7em-none-eabihf"
"riscv32imac-unknown-none-elf"
];
};
in with pkgs;
mkShell {
packages =
[ rust cargo-binutils probe-rs cargo-generate gdb openocd ];
2024-03-24 20:54:34 +00:00
RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library";
};
2024-03-22 22:29:45 +00:00
devShells.typst = with pkgs; mkShell { packages = [ typst ]; };
2023-11-12 22:27:50 +00:00
formatter = pkgs.nixfmt;
});
}