Switch to using rust-overlay

I need to enable nightly features, so this will let me do that.
This commit is contained in:
Kiana Sheibani 2023-08-27 04:30:45 -04:00
parent edcef12c2f
commit 349d63946c
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
2 changed files with 24 additions and 12 deletions

View file

@ -9,7 +9,9 @@
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
"rust-overlay": [
"rust-overlay"
]
},
"locked": {
"lastModified": 1692750383,
@ -79,26 +81,25 @@
"inputs": {
"crane": "crane",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"crane",
"flake-utils"
],
"nixpkgs": [
"crane",
"nixpkgs"
]
},
"locked": {
"lastModified": 1691374719,
"narHash": "sha256-HCodqnx1Mi2vN4f3hjRPc7+lSQy18vRn8xWW68GeQOg=",
"lastModified": 1693102271,
"narHash": "sha256-JuxJYl7zZ9FUOA/3Az5OPYWQfH9Y8SvtqqFnPKB6zUw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "b520a3889b24aaf909e287d19d406862ced9ffc9",
"rev": "1aac4029cfbc529f8b39c96d29fe1d09338f9110",
"type": "github"
},
"original": {

View file

@ -3,17 +3,28 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
crane.url = "github:ipetkov/crane";
crane.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
rust-overlay.follows = "rust-overlay";
};
};
outputs = { self, nixpkgs, crane, flake-utils, ... }:
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane, ... }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
craneLib = crane.lib.${system};
let pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
rustToolchain = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);
craneLib = crane.lib.${system}.overrideToolchain rustToolchain;
commonArgs = {
version = "0.1.0";
@ -32,7 +43,7 @@
# Run clippy (and deny all warnings) on the crate source
runClippy = craneLib.cargoClippy (commonArgs // {
pname = "ggelo-clippy-check";
pname = "ggelo";
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
inherit cargoArtifacts;
});
@ -49,7 +60,7 @@
checks.runClippy = runClippy;
devShells.default = pkgs.mkShell {
packages = with pkgs; [ rustc cargo pkg-config rust-analyzer ];
packages = with pkgs; [ rustToolchain pkg-config rust-analyzer ];
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
};
});