Skip to content

Commit

Permalink
add toolchain.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-J-Ward committed Oct 10, 2024
1 parent b1e46a4 commit 1943d4f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
21 changes: 21 additions & 0 deletions flake.lock

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

19 changes: 16 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
# Dev tools
Expand All @@ -14,8 +18,13 @@
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = { config, self', pkgs, lib, system, ... }:
perSystem = { config, self', lib, system, ... }:
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
config = { };
};
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
nonRustDeps = [
pkgs.pkg-config
Expand All @@ -27,8 +36,7 @@
rust-toolchain = python: pkgs.symlinkJoin {
name = "rust-toolchain";
paths = [
pkgs.rustc
pkgs.cargo
(pkgs.rust-bin.fromRustupToolchainFile ./toolchain.toml)
pkgs.clippy
pkgs.cargo-watch
pkgs.rust-analyzer
Expand All @@ -40,6 +48,11 @@
python-pkgs.polars
]))
pkgs.maturin
# used for cargo llvm-cov coverage
# pkgs.grcov
# pkgs.cargo-binutils
# pkgs.cargo-llvm-cov
# pkgs.rustc.llvmPackages.llvm
];
};
NIX_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
Expand Down
6 changes: 6 additions & 0 deletions toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# toolchain.toml
[toolchain]
channel = "stable"
components = [ "rustfmt", "rust-src", "llvm-tools" ]
profile = "default"

0 comments on commit 1943d4f

Please sign in to comment.