solutions/nix/default.nix

43 lines
988 B
Nix
Raw Normal View History

2021-04-18 21:43:32 +00:00
{ sources ? import ./sources.nix
}:
let
# default nixpkgs
pkgs = import sources.nixpkgs { };
# gitignore.nix
gitignoreSource = (import sources."gitignore.nix" { inherit (pkgs) lib; }).gitignoreSource;
2021-04-19 11:55:10 +00:00
pre-commit-hooks = (import sources."pre-commit-hooks.nix");
2021-04-18 21:43:32 +00:00
rust = (import ./rust.nix { inherit sources; });
src = gitignoreSource ./..;
in
{
inherit pkgs src;
# provided by shell.nix
2021-04-19 11:55:10 +00:00
devTools = with pkgs; with pre-commit-hooks; [
2021-04-18 21:43:32 +00:00
niv wasm-pack wasmtime valgrind protobuf clang llvm rocksdb
2021-04-19 11:55:10 +00:00
pre-commit nixpkgs-fmt nix-linter
2021-04-18 21:43:32 +00:00
rust
];
# to be built by github actions
ci = {
2021-04-19 11:55:10 +00:00
pre-commit-check = pre-commit-hooks.run {
inherit src;
hooks = {
shellcheck.enable = true;
nixpkgs-fmt.enable = true;
nix-linter.enable = true;
cargo-check.enable = true;
rustfmt.enable = true;
clippy.enable = true;
};
# generated files
excludes = [ "^nix/sources\.nix$" ];
};
2021-04-18 21:43:32 +00:00
};
}