Skip to content

Commit

Permalink
chore: add rust-toolchain to nix
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Oct 27, 2023
1 parent 3ff4fe2 commit 9703c7e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
24 changes: 24 additions & 0 deletions flake.lock

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

14 changes: 14 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@
# References: https://github.com/NixOS/nixpkgs/issues/260411
# See: https://lazamar.co.uk/nix-versions/?channel=nixos-unstable&package=tilt
tilt-pin-pkgs.url = "https://github.com/NixOS/nixpkgs/archive/e1ee359d16a1886f0771cc433a00827da98d861c.tar.gz";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};

outputs = {
self,
nixpkgs,
flake-utils,
tilt-pin-pkgs,
rust-overlay,
}:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [
Expand All @@ -29,8 +37,13 @@
nodejs = super.nodejs_20;
};
})
(import rust-overlay)
];
pkgs = import nixpkgs {inherit overlays system;};
rustVersion = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
rust-toolchain = rustVersion.override {
extensions = ["rust-analyzer" "rust-src"];
};
tilt-pin = import tilt-pin-pkgs {inherit system;};

buck2NativeBuildInputs = with pkgs; [
Expand All @@ -42,6 +55,7 @@
cacert
clang
lld
rust-toolchain
];

nativeBuildInputs = with pkgs;
Expand Down
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "stable"
profile = "default"

0 comments on commit 9703c7e

Please sign in to comment.