nix-init: refactor with nixfmt-rfc-style, passthru.tests.version and removing darwin sdk (#356985)

This commit is contained in:
Aleksana
2024-11-23 20:04:10 +08:00
committed by GitHub
+23 -21
View File
@@ -1,20 +1,22 @@
{ lib
, writeText
, rustPlatform
, fetchFromGitHub
, curl
, installShellFiles
, pkg-config
, bzip2
, libgit2
, openssl
, zlib
, zstd
, stdenv
, darwin
, spdx-license-list-data
, nix
, nurl
{
lib,
writeText,
rustPlatform,
fetchFromGitHub,
curl,
installShellFiles,
pkg-config,
bzip2,
libgit2,
openssl,
zlib,
zstd,
stdenv,
spdx-license-list-data,
nix,
nurl,
testers,
nix-init,
}:
let
@@ -51,10 +53,6 @@ rustPlatform.buildRustPackage rec {
openssl
zlib
zstd
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Security
] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
darwin.apple_sdk.frameworks.CoreFoundation
];
buildNoDefaultFeatures = true;
@@ -88,6 +86,10 @@ rustPlatform.buildRustPackage rec {
ZSTD_SYS_USE_PKG_CONFIG = true;
};
passthru.tests.version = testers.testVersion {
package = nix-init;
};
meta = with lib; {
description = "Command line tool to generate Nix packages from URLs";
mainProgram = "nix-init";