Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 25 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
Expand Down Expand Up @@ -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;
Expand All @@ -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";
Expand All @@ -105,5 +123,8 @@
inherit tokio-console;
default = self.packages.${system}.tokio-console;
};
checks = {
inherit tokio-console;
};
});
}
Loading