play/flake.nix

163 lines
4.8 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";
};
2023-11-12 22:27:50 +00:00
};
2024-07-07 21:13:56 +00:00
outputs =
{
self,
nixpkgs,
utils,
artemist-packages,
rust-overlay,
}:
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-07-07 21:13:56 +00:00
in
rec {
devShells.zephyr = artemist-packages.devShells.${system}.zephyr.override {
toolchains = with pkgs.zephyrPackages.toolchains; [
arm-zephyr-eabi
riscv64-zephyr-elf
];
modules = with pkgs.zephyrPackages.modules; [
mbedtls
hal_rpi_pico
hal_atmel
cmsis
];
extraPackages = with pkgs; [ pyocd ];
};
2024-02-23 05:45:11 +00:00
devShells.zephyr-west = devShells.zephyr.override {
enableWest = true;
zephyrSrc = null;
modules = [ ];
};
2024-07-07 21:13:56 +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"
];
};
2024-07-07 21:13:56 +00:00
rust-form = pkgs.rustPlatform.buildRustPackage rec {
pname = "form";
version = "0.10.0";
src = pkgs.fetchFromGitHub {
owner = "djmcgill";
repo = pname;
rev = "v${version}";
hash = "sha256-cqoc2sTtVdhTAQ65oaJKo1+YMfQu7eHCe8zjRPDz9zg=";
};
cargoHash = "sha256-dhPp93AH4VlOVJWXMMUwv8b53vLPdBY3WyaXE4kcEm4=";
};
in
with pkgs;
mkShell {
packages = [
cargo-binutils
cargo-generate
gdb
openocd
probe-rs
rust
rust-form
svd2rust
svdtools
2024-07-07 21:13:56 +00:00
];
RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library";
};
devShells.rust =
with pkgs;
2024-07-07 21:12:37 +00:00
mkShell {
2024-07-07 21:13:56 +00:00
nativeBuildInputs = [
rustc
cargo
rustfmt
clippy
];
2024-07-07 21:12:37 +00:00
RUST_SRC_PATH = "${rust.packages.stable.rustPlatform.rustLibSrc}";
};
2024-07-07 21:13:56 +00:00
devShells.avr =
with pkgs;
pkgsCross.avr.mkShell {
2024-07-07 21:13:56 +00:00
packages = [
avrdude
gnumake
];
2024-03-24 20:54:34 +00:00
LIBC = pkgsCross.avr.avrlibc;
};
2024-07-07 21:13:56 +00:00
devShells.emoji =
with pkgs;
mkShell {
packages = [
chromedriver
chromium
python3
2024-05-26 21:24:17 +00:00
python3Packages.aiohttp
python3Packages.black
python3Packages.ipython
python3Packages.trio
2024-05-26 21:24:17 +00:00
python3Packages.gql
(python3Packages.selenium.overrideAttrs (old: {
2024-07-07 21:13:56 +00:00
postInstall =
old.postInstall
+ ''
for ver in v85 v120 v121 v122; do
DEVTOOLS=../common/devtools/chromium/$ver
for proto in js browser; do
python3 ../common/devtools/convert_protocol_to_json.py \
$DEVTOOLS/"$proto"_protocol.pdl \
--map_binary_to_string=true \
$DEVTOOLS/"$proto"_protocol.json
done
mkdir -p $DST_PREFIX/common/devtools/$ver
python3 generate.py \
$DEVTOOLS/browser_protocol.json \
$DEVTOOLS/js_protocol.json \
$DST_PREFIX/common/devtools/$ver
done
2024-07-07 21:13:56 +00:00
'';
2024-07-07 21:13:56 +00:00
nativeBuildInputs = old.nativeBuildInputs ++ [ python3Packages.inflection ];
}))
];
CHROME = "${chromium}/bin/chromium";
};
2024-03-22 22:29:45 +00:00
devShells.typst = with pkgs; mkShell { packages = [ typst ]; };
2024-07-07 21:13:56 +00:00
formatter = pkgs.nixfmt-rfc-style;
}
);
2023-11-12 22:27:50 +00:00
}