Skip to content

Commit

Permalink
Add nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
KoviRobi committed Dec 20, 2023
0 parents commit cb231f3
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
82 changes: 82 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { self, rust-overlay, nixpkgs }:
let
system = "x86_64-linux";
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit overlays system;
};
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = [
# (pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
# targets = [ "thumbv6m-none-eabi" ];
# extensions = [ "rust-src" ];
# }))
(pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "llvm-tools-preview" ];
targets = [ "thumbv6m-none-eabi" ];
})
pkgs.rust-analyzer
pkgs.flip-link
pkgs.probe-run
pkgs.probe-rs
pkgs.elf2uf2-rs
pkgs.rustfmt
pkgs.cargo-binutils
pkgs.gcc-arm-embedded
# For compile_commands.json, run `bear cargo build -r` at least once
pkgs.bear
# For language server for the C files
pkgs.ccls
];
};
};
}

0 comments on commit cb231f3

Please sign in to comment.