2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, nix-update-script
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, stdenv
|
|
|
|
, coreutils
|
|
|
|
, bash
|
2023-08-04 22:07:22 +00:00
|
|
|
, pkg-config
|
|
|
|
, openssl
|
2023-07-15 17:15:38 +00:00
|
|
|
, direnv
|
|
|
|
, Security
|
2023-10-09 19:29:22 +00:00
|
|
|
, SystemConfiguration
|
2024-01-25 14:12:00 +00:00
|
|
|
, mise
|
2024-01-02 11:29:13 +00:00
|
|
|
, testers
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2024-01-25 14:12:00 +00:00
|
|
|
pname = "mise";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "2024.2.19";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-01-02 11:29:13 +00:00
|
|
|
owner = "jdx";
|
2024-01-25 14:12:00 +00:00
|
|
|
repo = "mise";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-SDGXSjCDdtjKn474s2SQm9YDHofMOmHuodLS2iu10Co=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
cargoHash = "sha256-4MEBIZOXjcLEyW0TB+AXWsEc24VZz8bGCkduHqbazuo=";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles pkg-config ];
|
2024-01-02 11:29:13 +00:00
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2024-01-25 14:12:00 +00:00
|
|
|
patchShebangs --build \
|
|
|
|
./test/data/plugins/**/bin/* \
|
|
|
|
./src/fake_asdf.rs \
|
|
|
|
./src/cli/reshim.rs \
|
|
|
|
./test/cwd/.mise/tasks/filetask
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
substituteInPlace ./src/env_diff.rs \
|
|
|
|
--replace '"bash"' '"${bash}/bin/bash"'
|
|
|
|
|
|
|
|
substituteInPlace ./src/cli/direnv/exec.rs \
|
|
|
|
--replace '"env"' '"${coreutils}/bin/env"' \
|
|
|
|
--replace 'cmd!("direnv"' 'cmd!("${direnv}/bin/direnv"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkFlags = [
|
|
|
|
# Requires .git directory to be present
|
|
|
|
"--skip=cli::plugins::ls::tests::test_plugin_list_urls"
|
|
|
|
];
|
|
|
|
cargoTestFlags = [ "--all-features" ];
|
|
|
|
# some tests access the same folders, don't test in parallel to avoid race conditions
|
|
|
|
dontUseCargoParallelTests = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
2024-01-25 14:12:00 +00:00
|
|
|
installManPage ./man/man1/mise.1
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
installShellCompletion \
|
2024-01-25 14:12:00 +00:00
|
|
|
--bash ./completions/mise.bash \
|
|
|
|
--fish ./completions/mise.fish \
|
|
|
|
--zsh ./completions/_mise
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
2024-01-25 14:12:00 +00:00
|
|
|
tests.version = testers.testVersion { package = mise; };
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
2024-01-25 14:12:00 +00:00
|
|
|
homepage = "https://mise.jdx.dev";
|
|
|
|
description = "The front-end to your dev env";
|
|
|
|
changelog = "https://github.com/jdx/mise/releases/tag/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ konradmalik ];
|
2024-01-25 14:12:00 +00:00
|
|
|
mainProgram = "mise";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
}
|