From dcf8b95055b93bc8945dd6cb85eb9d8c50c221a7 Mon Sep 17 00:00:00 2001 From: Evan Stoll Date: Sun, 17 Apr 2022 21:30:05 -0400 Subject: [PATCH] didyoumean: init at 1.1.0 --- pkgs/tools/misc/didyoumean/default.nix | 32 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/tools/misc/didyoumean/default.nix diff --git a/pkgs/tools/misc/didyoumean/default.nix b/pkgs/tools/misc/didyoumean/default.nix new file mode 100644 index 000000000000..cd7b8270a1a9 --- /dev/null +++ b/pkgs/tools/misc/didyoumean/default.nix @@ -0,0 +1,32 @@ +{ lib +, stdenv +, rustPlatform +, fetchFromGitHub +, libxcb +# Darwin dependencies +, AppKit +}: + +rustPlatform.buildRustPackage rec { + pname = "didyoumean"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "hisbaan"; + repo = "didyoumean"; + rev = "v${version}"; + sha256 = "sha256-t2bmvz05vWIxQhC474q/9uky1kAQoFN8Z+qflw5Vj68="; + }; + + cargoSha256 = "sha256-4DbziI9enib4pm9/P4WEu15glIxtejaV2GCqbzuxxyw="; + + buildInputs = lib.optional stdenv.isLinux [ libxcb ] + ++ lib.optionals stdenv.isDarwin [ AppKit ]; + + meta = with lib; { + description = "A CLI spelling corrector for when you're unsure"; + homepage = "https://github.com/hisbaan/didyoumean"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ evanjs ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 434d94509ab4..767785f1fbc5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -433,6 +433,10 @@ with pkgs; devour = callPackage ../tools/X11/devour {}; + didyoumean = callPackage ../tools/misc/didyoumean { + inherit (darwin.apple_sdk.frameworks) AppKit; + }; + diffPlugins = (callPackage ../build-support/plugins.nix {}).diffPlugins; dieHook = makeSetupHook {} ../build-support/setup-hooks/die.sh;