dotfiles/templates/rust-monorepo/flake.nix

35 lines
1.0 KiB
Nix
Raw Permalink Normal View History

2022-12-27 04:51:32 +00:00
{
inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
2022-12-28 02:14:29 +00:00
rust-overlay.url = "github:oxalica/rust-overlay";
2022-12-27 04:51:32 +00:00
};
outputs = { self, nixpkgs, utils, naersk, rust-overlay }:
utils.lib.eachDefaultSystem (system:
let
overlays = [ rust-overlay.overlays.default ];
pkgs = import nixpkgs { inherit system overlays; };
rust_pkgs = (pkgs.rust-bin.selectLatestNightlyWith
(
toolchain:
toolchain.default.override {
extensions = [ "rust-src" "rust-analyzer" "rust-docs" "clippy" "miri" ];
}
));
2022-12-27 04:51:32 +00:00
naersk-lib = pkgs.callPackage naersk { };
in
{
defaultPackage = naersk-lib.buildPackage ./.;
devShell = with pkgs; mkShell {
buildInputs = [
rust_pkgs
2022-12-27 04:51:32 +00:00
];
shellHook = ''
# nix flake update # is this even needed?
'';
};
});
}