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";
|
|
|
|
};
|
|
|
|
|
2023-10-27 13:03:48 -05:00
|
|
|
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,
|
2023-10-27 13:03:48 -05:00
|
|
|
nixpkgs-mozilla,
|
2023-10-25 13:08:37 -05:00
|
|
|
utils,
|
|
|
|
naersk,
|
|
|
|
}:
|
|
|
|
utils.lib.eachDefaultSystem (system: let
|
2023-10-27 13:03:48 -05:00
|
|
|
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 {
|
2023-10-27 13:03:48 -05:00
|
|
|
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 {
|
2023-10-27 13:03:48 -05:00
|
|
|
buildInputs = [toolchain];
|
2023-10-25 13:08:37 -05:00
|
|
|
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|