# A derivation for the `essential-debugger` crate. { lib , stdenv , darwin , rustPlatform }: let src = builtins.path { path = ./.; filter = path: type: let keepFiles = [ "Cargo.lock" "Cargo.toml" "src" "tests" ]; includeDirs = [ "src" "tests" ]; isPathInIncludeDirs = dir: lib.strings.hasInfix dir path; in if lib.lists.any (p: p == (baseNameOf path)) keepFiles then true else lib.lists.any (dir: isPathInIncludeDirs dir) includeDirs ; }; crateTOML = "${src}/Cargo.toml"; lockFile = "${src}/Cargo.lock"; in rustPlatform.buildRustPackage { inherit src; pname = "essential-debugger"; version = (builtins.fromTOML (builtins.readFile crateTOML)).package.version; # We run tests separately in CI. doCheck = false; buildInputs = lib.optionals stdenv.isLinux [ ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ]; cargoLock = { inherit lockFile; }; }