Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
83 lines
2.2 KiB
Nix
83 lines
2.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
buildPackages,
|
|
installShellFiles,
|
|
nix-update-script,
|
|
}:
|
|
|
|
let
|
|
version = "0.16.10";
|
|
in
|
|
buildGoModule {
|
|
pname = "mrpack-install";
|
|
inherit version;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "nothub";
|
|
repo = "mrpack-install";
|
|
tag = "v${version}";
|
|
hash = "sha256-mTAXFK97t10imdICpg0UI4YLF744oscJqoOIBG5GEkc=";
|
|
};
|
|
|
|
vendorHash = "sha256-az+NpP/hCIq2IfO8Bmn/qG3JVypeDljJ0jWg6yT6hks=";
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X github.com/nothub/mrpack-install/buildinfo.version=${version}"
|
|
"-X github.com/nothub/mrpack-install/buildinfo.date=1970-01-01T00:00:00Z"
|
|
];
|
|
|
|
checkFlags =
|
|
let
|
|
skippedTests = [
|
|
# Skip tests that require network access
|
|
"TestFetchMetadata"
|
|
"TestClient_VersionFromHash"
|
|
"TestClient_GetDependencies"
|
|
"TestClient_GetProjectVersions_Count"
|
|
"TestClient_GetVersion"
|
|
"TestClient_CheckProjectValidity_Slug"
|
|
"Test_GetProject_404"
|
|
"TestClient_GetProjects_Count"
|
|
"TestClient_GetProjectVersions_Filter_NoResults"
|
|
"Test_GetProject_Success"
|
|
"TestClient_CheckProjectValidity_Id"
|
|
"TestClient_GetLatestGameVersion"
|
|
"TestClient_GetProjectVersions_Filter_Results"
|
|
"TestClient_GetProjects_Slug"
|
|
"TestClient_GetVersions"
|
|
"TestGetPlayerUuid"
|
|
];
|
|
in
|
|
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
];
|
|
|
|
postInstall =
|
|
let
|
|
mrpack-install = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/mrpack-install";
|
|
in
|
|
lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
|
|
installShellCompletion --cmd mrpack-install \
|
|
--bash <(${mrpack-install} completion bash) \
|
|
--fish <(${mrpack-install} completion fish) \
|
|
--zsh <(${mrpack-install} completion zsh)
|
|
'';
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "CLI application for installing Minecraft servers and Modrinth modpacks";
|
|
homepage = "https://github.com/nothub/mrpack-install";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ encode42 ];
|
|
mainProgram = "mrpack-install";
|
|
};
|
|
}
|