Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust version support changes #6

Merged
merged 2 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 56 additions & 23 deletions flake.lock

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

31 changes: 15 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
inputs.nixpkgs.follows = "nixpkgs";
};

fenix = {
url = "github:nix-community/fenix";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-analyzer-src.follows = "";
};

flake-utils.url = "github:numtide/flake-utils";
Expand All @@ -25,23 +24,20 @@
};
};

outputs = { self, nixpkgs, nix-filter, crane, fenix, flake-utils, advisory-db, ... }:
outputs = { self, nixpkgs, nix-filter, crane, rust-overlay, flake-utils, advisory-db, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};

filter = nix-filter.lib;

inherit (pkgs) lib makeRustPlatform python3Packages;

channel = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml)).toolchain.channel;
rust-toolchain = fenix.packages.${system}.toolchainOf {
inherit channel;
sha256 = "sha256-otgm+7nEl94JG/B+TYhWseZsHV1voGcBsW/lOD2/68g=";
};
craneLib = crane.lib.${system}.overrideToolchain rust-toolchain.toolchain;
rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
craneLib = crane.lib.${system}.overrideToolchain rust-toolchain;
src = craneLib.cleanCargoSource (craneLib.path ./.);

# Common arguments can be set here to avoid repeating them later
Expand All @@ -61,11 +57,13 @@
};

craneLibLLvmTools = craneLib.overrideToolchain
(fenix.packages.${system}.complete.withComponents [
"cargo"
"llvm-tools"
"rustc"
]);
(rust-toolchain.override {
extensions = [
"cargo"
"llvm-tools-preview"
"rustc"
];
});

# Build *just* the cargo dependencies, so we can reuse
# all of that work (e.g. via cachix) when running in CI
Expand All @@ -78,7 +76,8 @@
});

rustPlatform = makeRustPlatform {
inherit (rust-toolchain) cargo rustc;
rustc = rust-toolchain;
cargo = rust-toolchain;
};

unblob-native = python3Packages.buildPythonPackage
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.60.0"
channel = "1.65.0"
profile = "default"