2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, openssl
|
2020-10-07 09:15:18 +00:00
|
|
|
, zlib
|
2021-08-08 23:34:03 +00:00
|
|
|
, zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, xorg
|
2023-02-16 17:41:37 +00:00
|
|
|
, Libsystem
|
2020-04-24 23:36:52 +00:00
|
|
|
, AppKit
|
|
|
|
, Security
|
2021-05-20 23:08:51 +00:00
|
|
|
, nghttp2
|
|
|
|
, libgit2
|
2024-02-29 20:09:43 +00:00
|
|
|
# string interpolation dependends on a date that is erroring out
|
|
|
|
# this will be fixed in releases after 0.90.1
|
|
|
|
, doCheck ? false
|
2023-03-04 12:14:45 +00:00
|
|
|
, withDefaultFeatures ? true
|
|
|
|
, additionalFeatures ? (p: p)
|
2022-06-16 17:23:12 +00:00
|
|
|
, testers
|
|
|
|
, nushell
|
2022-12-28 21:21:41 +00:00
|
|
|
, nix-update-script
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
let
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.94.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage {
|
|
|
|
pname = "nushell";
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-07-15 17:15:38 +00:00
|
|
|
owner = "nushell";
|
|
|
|
repo = "nushell";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-uwtmSyNJJUtaFrBd9W89ZQpWzBOswOLWTevkPlg6Ano=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
cargoHash = "sha256-4caqvbNxXRZksQrySydPlzn9S6gr2xPLFLSEcAEGnI8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ]
|
2023-03-04 12:14:45 +00:00
|
|
|
++ lib.optionals (withDefaultFeatures && stdenv.isLinux) [ python3 ]
|
2022-09-09 14:08:57 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ rustPlatform.bindgenHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
buildInputs = [ openssl zstd ]
|
2023-07-15 17:15:38 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ zlib Libsystem Security ]
|
2023-03-04 12:14:45 +00:00
|
|
|
++ lib.optionals (withDefaultFeatures && stdenv.isLinux) [ xorg.libX11 ]
|
|
|
|
++ lib.optionals (withDefaultFeatures && stdenv.isDarwin) [ AppKit nghttp2 libgit2 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildNoDefaultFeatures = !withDefaultFeatures;
|
|
|
|
buildFeatures = additionalFeatures [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit doCheck;
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
echo "Running cargo test"
|
2023-07-15 17:15:38 +00:00
|
|
|
HOME=$(mktemp -d) cargo test
|
2020-07-18 16:06:22 +00:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru = {
|
|
|
|
shellPath = "/bin/nu";
|
2022-06-16 17:23:12 +00:00
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = nushell;
|
|
|
|
};
|
2022-12-28 21:21:41 +00:00
|
|
|
updateScript = nix-update-script { };
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Modern shell written in Rust";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://www.nushell.sh/";
|
|
|
|
license = licenses.mit;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne johntitor joaquintrinanes ];
|
2023-07-15 17:15:38 +00:00
|
|
|
mainProgram = "nu";
|
|
|
|
};
|
|
|
|
}
|