lriamol/flake.nix

59 lines
1.3 KiB
Nix
Raw Normal View History

2023-10-25 13:08:37 -05:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2023-10-27 10:06:49 -05:00
naersk = {
url = "github:nix-community/naersk/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-mozilla = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
};
2023-10-25 13:08:37 -05:00
utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
nixpkgs-mozilla,
2023-10-25 13:08:37 -05:00
utils,
naersk,
}:
utils.lib.eachDefaultSystem (system: let
pkgs = (import nixpkgs) {
inherit system;
overlays = [
(import nixpkgs-mozilla)
];
};
toolchain =
(pkgs.rustChannelOf {
rustToolchain = ./rust-toolchain.toml;
sha256 = "sha256-rLP8+fTxnPHoR96ZJiCa/5Ans1OojI7MLsmSqR2ip8o=";
})
.rust;
naersk' = pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
};
2023-10-25 13:08:37 -05:00
in {
packages.default = naersk'.buildPackage ./.;
2023-10-27 10:06:49 -05:00
formatter = nixpkgs.legacyPackages.${system}.alejandra;
checks = {
inherit (self.packages.${system}) default;
2023-10-27 11:37:26 -05:00
# TODO: clippy
2023-10-27 10:06:49 -05:00
};
2023-10-25 13:08:37 -05:00
devShell = with pkgs;
mkShell {
buildInputs = [toolchain];
2023-10-25 13:08:37 -05:00
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
});
}