feat: initial commit for corne
This commit is contained in:
69
flake.nix
Normal file
69
flake.nix
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
description = "A very basic clang devshell flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
crates-nix = {
|
||||
url = "github:uttarayan21/crates.nix";
|
||||
inputs.crates-io-index.follows = "crates-io-index";
|
||||
};
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
crates-io-index = {
|
||||
url = "github:rust-lang/crates.io-index";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
crates-nix,
|
||||
rust-overlay,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
overlays = [
|
||||
# (final: prev: {
|
||||
# })
|
||||
rust-overlay.overlays.default
|
||||
];
|
||||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
};
|
||||
crates = crates-nix.mkLib {inherit pkgs;};
|
||||
stableToolchain = pkgs.rust-bin.stable.latest.default.override {
|
||||
targets = ["thumbv7em-none-eabihf"];
|
||||
extensions = ["rust-src" "llvm-tools"];
|
||||
};
|
||||
stableToolchainWithLLvmTools = pkgs.rust-bin.stable.latest.default.override {
|
||||
targets = ["thumbv7em-none-eabihf"];
|
||||
extensions = ["rust-src" "llvm-tools"];
|
||||
};
|
||||
stableToolchainWithRustAnalyzer = pkgs.rust-bin.stable.latest.default.override {
|
||||
targets = ["thumbv7em-none-eabihf"];
|
||||
extensions = ["rust-src" "llvm-tools" "rust-analyzer"];
|
||||
};
|
||||
in {
|
||||
# packages = {
|
||||
# };
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [clang pkg-config];
|
||||
buildInputs = with pkgs; [libiconv];
|
||||
# PKG_CONFIG_PATH = pkgs.lib.makeSearchPath "lib/pkgconfig" (with pkgs; [ncnn]);
|
||||
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
|
||||
packages = with pkgs; [
|
||||
(crates.buildCrate "rmkit" {})
|
||||
(crates.buildCrate "cargo-hex-to-uf2" {})
|
||||
flip-link
|
||||
cargo-make
|
||||
cargo-binutils
|
||||
stableToolchainWithRustAnalyzer
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user