{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
crane.url = "github:ipetkov/crane";
fenix.url = "github:nix-community/fenix";
};
outputs = { self, nixpkgs, flake-utils, crane, fenix, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
# overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system;
};
toolchain = (fenix.packages.${system}.stable.withComponents [
"cargo"
"clippy"
"rustfmt"
"rust-src"
"llvm-tools-preview"
]);
craneLib = (crane.mkLib nixpkgs.legacyPackages.${system}).overrideToolchain toolchain;
in
{
defaultPackage = craneLib.buildPackage {
src = ./.;
};
devShells.default = with pkgs; mkShell {
buildInputs = [
toolchain
cargo-llvm-cov
cargo-nextest
rust-analyzer
sops
];
};
}
);
}