48 lines
930 B
Nix
48 lines
930 B
Nix
{
|
|
sources ? import ./npins,
|
|
pkgs ? import sources.nixpkgs {},
|
|
}:
|
|
let
|
|
check = (import sources.git-hooks).run {
|
|
src = ./.;
|
|
|
|
hooks = {
|
|
# Nix Hooks
|
|
statix.enable = true;
|
|
deadnix.enable = true;
|
|
rfc101 = {
|
|
enable = true;
|
|
|
|
name = "RFC-101 formatting";
|
|
entry = "${pkgs.lib.getExe pkgs.nixfmt-rfc-style}";
|
|
files = "\\.nix$";
|
|
};
|
|
|
|
# Rust
|
|
cargo-check.enable = true;
|
|
rustfmt.enable = true;
|
|
|
|
# Misc Hooks
|
|
commitizen.enable = true;
|
|
};
|
|
};
|
|
in
|
|
{
|
|
inherit pkgs;
|
|
package = pkgs.callPackage ./pkgs {};
|
|
shell = pkgs.mkShell {
|
|
name = "multitenant-tvix-binary-cache";
|
|
buildInputs = check.enabledPackages ++ [
|
|
pkgs.cargo
|
|
pkgs.cargo-edit
|
|
pkgs.protobuf
|
|
pkgs.rustc
|
|
pkgs.rust-analyzer
|
|
(pkgs.rustfmt.override { asNightly = true; })
|
|
];
|
|
shellHook = ''
|
|
${check.shellHook}
|
|
'';
|
|
|
|
};
|
|
}
|