From fe87136b52bcecdc009f2dc189e3ed2111b06a6e Mon Sep 17 00:00:00 2001 From: awwpotato Date: Sat, 19 Apr 2025 22:00:44 -0700 Subject: [PATCH] moon: modernize --- .../tools/build-managers/moon/default.nix | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pkgs/development/tools/build-managers/moon/default.nix b/pkgs/development/tools/build-managers/moon/default.nix index 746c35a1d53f..ab997d4bbfb0 100644 --- a/pkgs/development/tools/build-managers/moon/default.nix +++ b/pkgs/development/tools/build-managers/moon/default.nix @@ -2,24 +2,23 @@ lib, rustPlatform, fetchFromGitHub, - darwin, - stdenv, openssl, pkg-config, + versionCheckHook, + nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "moon"; version = "1.34.3"; src = fetchFromGitHub { owner = "moonrepo"; - repo = pname; - rev = "v${version}"; + repo = "moon"; + tag = "v${finalAttrs.version}"; hash = "sha256-LLKHRybTSUhz5YfaV7scVASa6TJqkHDbpVfzL2bANtQ="; }; - useFetchCargoVendor = true; cargoHash = "sha256-Rx6g+J7Sh1G8ZrUP55oxrUwCyBp0WV67yG6+ql9J5QI="; env = { @@ -27,22 +26,23 @@ rustPlatform.buildRustPackage rec { OPENSSL_NO_VENDOR = 1; }; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk.frameworks.Security - darwin.apple_sdk.frameworks.SystemConfiguration - ]; + buildInputs = [ openssl ]; nativeBuildInputs = [ pkg-config ]; # Some tests fail, because test using internet connection and install NodeJS by example doCheck = false; - meta = with lib; { + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + + passthru.updateScript = nix-update-script { }; + + meta = { description = "Task runner and repo management tool for the web ecosystem, written in Rust"; mainProgram = "moon"; homepage = "https://github.com/moonrepo/moon"; - license = licenses.mit; - maintainers = with maintainers; [ flemzord ]; + changelog = "https://github.com/moonrepo/moon/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ flemzord ]; }; -} +})