diff --git a/pkgs/by-name/mo/moon/package.nix b/pkgs/by-name/mo/moon/package.nix new file mode 100644 index 000000000000..7dcaa8428fa2 --- /dev/null +++ b/pkgs/by-name/mo/moon/package.nix @@ -0,0 +1,66 @@ +{ + lib, + stdenv, + rustPlatform, + fetchFromGitHub, + openssl, + pkg-config, + versionCheckHook, + nix-update-script, + installShellFiles, + buildPackages, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "moon"; + version = "1.35.1"; + + src = fetchFromGitHub { + owner = "moonrepo"; + repo = "moon"; + tag = "v${finalAttrs.version}"; + hash = "sha256-/MKv+k6GZHpqnwheLYAbIAtIT8cZoiNg1EFUNQLbiQk="; + }; + + cargoHash = "sha256-CyvcC46FUeEPcDvHiIBunnM4H4Esp2Q6GRhJZgXhlJk="; + + env = { + RUSTFLAGS = "-C strip=symbols"; + OPENSSL_NO_VENDOR = 1; + }; + + buildInputs = [ openssl ]; + nativeBuildInputs = [ + pkg-config + installShellFiles + ]; + + postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( + let + emulator = stdenv.hostPlatform.emulator buildPackages; + in + '' + installShellCompletion --cmd moon \ + --bash <(${emulator} $out/bin/moon completions --shell bash) \ + --fish <(${emulator} $out/bin/moon completions --shell fish) \ + --zsh <(${emulator} $out/bin/moon completions --shell zsh) + '' + ); + + # Some tests fail, because test using internet connection and install NodeJS by example + doCheck = false; + + 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"; + changelog = "https://github.com/moonrepo/moon/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ flemzord ]; + }; +}) diff --git a/pkgs/development/tools/build-managers/moon/default.nix b/pkgs/development/tools/build-managers/moon/default.nix deleted file mode 100644 index 746c35a1d53f..000000000000 --- a/pkgs/development/tools/build-managers/moon/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - lib, - rustPlatform, - fetchFromGitHub, - darwin, - stdenv, - openssl, - pkg-config, -}: - -rustPlatform.buildRustPackage rec { - pname = "moon"; - version = "1.34.3"; - - src = fetchFromGitHub { - owner = "moonrepo"; - repo = pname; - rev = "v${version}"; - hash = "sha256-LLKHRybTSUhz5YfaV7scVASa6TJqkHDbpVfzL2bANtQ="; - }; - - useFetchCargoVendor = true; - cargoHash = "sha256-Rx6g+J7Sh1G8ZrUP55oxrUwCyBp0WV67yG6+ql9J5QI="; - - env = { - RUSTFLAGS = "-C strip=symbols"; - OPENSSL_NO_VENDOR = 1; - }; - - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk.frameworks.Security - darwin.apple_sdk.frameworks.SystemConfiguration - ]; - nativeBuildInputs = [ pkg-config ]; - - # Some tests fail, because test using internet connection and install NodeJS by example - doCheck = false; - - meta = with lib; { - 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 ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b04225aaf7a..5e79fba3425e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8452,8 +8452,6 @@ with pkgs; ''; }; - moon = callPackage ../development/tools/build-managers/moon/default.nix { }; - mopsa = ocamlPackages.mopsa.bin; haskell-ci =