|
@@ -22,8 +22,6 @@
|
|
|
crane = {
|
|
crane = {
|
|
|
url = "github:ipetkov/crane";
|
|
url = "github:ipetkov/crane";
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
- pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
outputs =
|
|
outputs =
|
|
@@ -31,7 +29,6 @@
|
|
|
, nixpkgs
|
|
, nixpkgs
|
|
|
, rust-overlay
|
|
, rust-overlay
|
|
|
, flake-utils
|
|
, flake-utils
|
|
|
- , pre-commit-hooks
|
|
|
|
|
, crane
|
|
, crane
|
|
|
, ...
|
|
, ...
|
|
|
}@inputs:
|
|
}@inputs:
|
|
@@ -532,48 +529,10 @@
|
|
|
|
|
|
|
|
# FFI Python tests
|
|
# FFI Python tests
|
|
|
ffi-tests = ffiTests;
|
|
ffi-tests = ffiTests;
|
|
|
-
|
|
|
|
|
- # Pre-commit checks
|
|
|
|
|
- pre-commit-check =
|
|
|
|
|
- let
|
|
|
|
|
- # this is a hack based on https://github.com/cachix/pre-commit-hooks.nix/issues/126
|
|
|
|
|
- # we want to use our own rust stuff from oxalica's overlay
|
|
|
|
|
- _rust = pkgs.rust-bin.stable.latest.default;
|
|
|
|
|
- rust = pkgs.buildEnv {
|
|
|
|
|
- name = _rust.name;
|
|
|
|
|
- inherit (_rust) meta;
|
|
|
|
|
- buildInputs = [ pkgs.makeWrapper ];
|
|
|
|
|
- paths = [ _rust ];
|
|
|
|
|
- pathsToLink = [
|
|
|
|
|
- "/"
|
|
|
|
|
- "/bin"
|
|
|
|
|
- ];
|
|
|
|
|
- postBuild = ''
|
|
|
|
|
- for i in $out/bin/*; do
|
|
|
|
|
- wrapProgram "$i" --prefix PATH : "$out/bin"
|
|
|
|
|
- done
|
|
|
|
|
- '';
|
|
|
|
|
- };
|
|
|
|
|
- in
|
|
|
|
|
- pre-commit-hooks.lib.${system}.run {
|
|
|
|
|
- src = ./.;
|
|
|
|
|
- hooks = {
|
|
|
|
|
- rustfmt = {
|
|
|
|
|
- enable = true;
|
|
|
|
|
- entry = lib.mkForce "${rust}/bin/cargo-fmt fmt --all -- --config format_code_in_doc_comments=true --check --color always";
|
|
|
|
|
- };
|
|
|
|
|
- nixpkgs-fmt.enable = true;
|
|
|
|
|
- typos.enable = true;
|
|
|
|
|
- commitizen.enable = true; # conventional commits
|
|
|
|
|
- };
|
|
|
|
|
- };
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
devShells =
|
|
devShells =
|
|
|
let
|
|
let
|
|
|
- # pre-commit-checks
|
|
|
|
|
- _shellHook = (self.checks.${system}.pre-commit-check.shellHook or "");
|
|
|
|
|
-
|
|
|
|
|
# devShells
|
|
# devShells
|
|
|
msrv = pkgs.mkShell (
|
|
msrv = pkgs.mkShell (
|
|
|
{
|
|
{
|
|
@@ -581,7 +540,6 @@
|
|
|
cargo update
|
|
cargo update
|
|
|
cargo update home --precise 0.5.11
|
|
cargo update home --precise 0.5.11
|
|
|
cargo update typed-index-collections --precise 3.3.0
|
|
cargo update typed-index-collections --precise 3.3.0
|
|
|
- ${_shellHook}
|
|
|
|
|
";
|
|
";
|
|
|
buildInputs = buildInputs ++ [ msrv_toolchain ];
|
|
buildInputs = buildInputs ++ [ msrv_toolchain ];
|
|
|
inherit nativeBuildInputs;
|
|
inherit nativeBuildInputs;
|
|
@@ -592,7 +550,6 @@
|
|
|
stable = pkgs.mkShell (
|
|
stable = pkgs.mkShell (
|
|
|
{
|
|
{
|
|
|
shellHook = ''
|
|
shellHook = ''
|
|
|
- ${_shellHook}
|
|
|
|
|
# Needed for github ci
|
|
# Needed for github ci
|
|
|
export LD_LIBRARY_PATH=${
|
|
export LD_LIBRARY_PATH=${
|
|
|
pkgs.lib.makeLibraryPath [
|
|
pkgs.lib.makeLibraryPath [
|
|
@@ -628,7 +585,6 @@
|
|
|
nightly = pkgs.mkShell (
|
|
nightly = pkgs.mkShell (
|
|
|
{
|
|
{
|
|
|
shellHook = ''
|
|
shellHook = ''
|
|
|
- ${_shellHook}
|
|
|
|
|
# Needed for github ci
|
|
# Needed for github ci
|
|
|
export LD_LIBRARY_PATH=${
|
|
export LD_LIBRARY_PATH=${
|
|
|
pkgs.lib.makeLibraryPath [
|
|
pkgs.lib.makeLibraryPath [
|
|
@@ -664,7 +620,6 @@
|
|
|
integration = pkgs.mkShell (
|
|
integration = pkgs.mkShell (
|
|
|
{
|
|
{
|
|
|
shellHook = ''
|
|
shellHook = ''
|
|
|
- ${_shellHook}
|
|
|
|
|
# Ensure Docker is available
|
|
# Ensure Docker is available
|
|
|
if ! command -v docker &> /dev/null; then
|
|
if ! command -v docker &> /dev/null; then
|
|
|
echo "Docker is not installed or not in PATH"
|
|
echo "Docker is not installed or not in PATH"
|
|
@@ -688,7 +643,6 @@
|
|
|
ffi = pkgs.mkShell (
|
|
ffi = pkgs.mkShell (
|
|
|
{
|
|
{
|
|
|
shellHook = ''
|
|
shellHook = ''
|
|
|
- ${_shellHook}
|
|
|
|
|
echo "FFI development shell"
|
|
echo "FFI development shell"
|
|
|
echo " just ffi-test - Run Python FFI tests"
|
|
echo " just ffi-test - Run Python FFI tests"
|
|
|
echo " just ffi-dev-python - Launch Python REPL with CDK FFI"
|
|
echo " just ffi-dev-python - Launch Python REPL with CDK FFI"
|