diff --git a/flake.lock b/flake.lock index 75d63b67e..afbb3e410 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1707689078, - "narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=", + "lastModified": 1759036355, + "narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8", + "rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127", "type": "github" }, "original": { @@ -43,19 +43,16 @@ }, "rust-overlay": { "inputs": { - "flake-utils": [ - "flake-utils" - ], "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1707790272, - "narHash": "sha256-KQXPNl3BLdRbz7xx+mwIq/017fxLRk6JhXHxVWCKsTU=", + "lastModified": 1759113356, + "narHash": "sha256-xm4kEUcV2jk6u15aHazFP4YsMwhq+PczA+Ul/4FDKWI=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "8dfbe2dffc28c1a18a29ffa34d5d0b269622b158", + "rev": "be3b8843a2be2411500f6c052876119485e957a2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 992a1187a..f8ead2d40 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,6 @@ url = "github:oxalica/rust-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; }; }; }; @@ -66,12 +65,32 @@ pname = cargoTOML.package.name; version = cargoTOML.package.version; - nativeBuildInputs = [ protobuf ]; + nativeBuildInputs = [ + installShellFiles + protobuf + ]; + + RUSTFLAGS = "--cfg tokio_unstable"; inherit src; cargoLock = { lockFile = "${src}/Cargo.lock"; }; + checkFlags = [ + # tests depend upon git repository at test execution time + "--skip bootstrap" + "--skip config::tests::args_example_changed" + "--skip config::tests::toml_example_changed" + "--skip cli_tests" + ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd tokio-console \ + --bash <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion bash) \ + --fish <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion fish) \ + --zsh <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion zsh) + ''; + meta = { inherit (cargoTOML.package) description homepage license; maintainers = cargoTOML.package.authors; @@ -84,8 +103,7 @@ devShell = with pkgs; mkShell { name = "tokio-console-env"; - buildInputs = tokio-console.buildInputs ++ lib.optional stdenv.isDarwin libiconv; - nativeBuildInputs = tokio-console.nativeBuildInputs; + inputsFrom = [ tokio-console ]; RUST_SRC_PATH = "${rustPlatform.rustLibSrc}"; CARGO_TERM_COLOR = "always"; RUST_BACKTRACE = "full"; @@ -105,5 +123,8 @@ inherit tokio-console; default = self.packages.${system}.tokio-console; }; + checks = { + inherit tokio-console; + }; }); }