2019-11-09 10:20:00 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
2019-11-12 10:20:00 +01:00
|
|
|
, python3
|
|
|
|
, xorg
|
2019-11-09 10:20:00 +01:00
|
|
|
, libiconv
|
2019-11-12 10:20:00 +01:00
|
|
|
, AppKit
|
2019-11-09 10:20:00 +01:00
|
|
|
, Security
|
2019-12-19 15:26:35 +01:00
|
|
|
, withStableFeatures ? true
|
2019-11-09 10:20:00 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "nushell";
|
2020-01-02 11:34:35 +01:00
|
|
|
version = "0.7.1";
|
2019-11-09 10:20:00 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2020-01-02 11:34:35 +01:00
|
|
|
rev = "f9da7f7d58da3ead2aaba6a519c554d1b199c158"; # 0.7.1 on crates.io
|
|
|
|
sha256 = "0k662wq2m3xfnzkkrsiv5h2m9y3l44fr3gab933ggrdgj2xydqnh";
|
2019-11-09 10:20:00 +01:00
|
|
|
};
|
|
|
|
|
2019-12-19 10:17:23 +01:00
|
|
|
cargoSha256 = "0bdxlbl33kilp9ai40dvdzlx9vcl8r21br82r5ljs2pg521jd66p";
|
2019-11-09 10:20:00 +01:00
|
|
|
|
2019-11-12 10:20:00 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ]
|
2019-12-19 15:26:35 +01:00
|
|
|
++ stdenv.lib.optionals (withStableFeatures && stdenv.isLinux) [ python3 ];
|
2019-11-09 10:20:00 +01:00
|
|
|
|
|
|
|
buildInputs = stdenv.lib.optionals stdenv.isLinux [ openssl ]
|
2019-11-12 10:20:00 +01:00
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ]
|
2019-12-19 15:26:35 +01:00
|
|
|
++ stdenv.lib.optionals (withStableFeatures && stdenv.isLinux) [ xorg.libX11 ]
|
|
|
|
++ stdenv.lib.optionals (withStableFeatures && stdenv.isDarwin) [ AppKit ];
|
2019-11-12 10:20:00 +01:00
|
|
|
|
2019-12-19 15:26:35 +01:00
|
|
|
cargoBuildFlags = stdenv.lib.optional withStableFeatures "--features=stable";
|
2019-11-09 10:20:00 +01:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A modern shell written in Rust";
|
|
|
|
homepage = "https://www.nushell.sh/";
|
|
|
|
license = licenses.mit;
|
2019-11-27 07:49:18 +01:00
|
|
|
maintainers = with maintainers; [ filalex77 marsam ];
|
2020-01-02 11:34:35 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
|
2019-11-09 10:20:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
shellPath = "/bin/nu";
|
|
|
|
};
|
|
|
|
}
|