Unverified Commit 04f0c72e authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

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

parents 71d5dab9 ee2d6d1e
Loading
Loading
Loading
Loading
+23 −21
Original line number Diff line number Diff line
{ 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";