1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00
nixpkgs/pkgs/shells/nushell/default.nix
2020-11-26 14:09:58 +00:00

58 lines
1.3 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, rustPlatform
, openssl
, zlib
, pkg-config
, python3
, xorg
, libiconv
, AppKit
, Security
, withStableFeatures ? true
}:
rustPlatform.buildRustPackage rec {
pname = "nushell";
version = "0.23.0";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "0rbg0jchg59x0g4h0xahdm9qah8l8g4i2s8lkaqzdkm4yv29gqx4";
};
cargoSha256 = "1sbgn68n0rqh1m98dm3r2a3pqqqx4v7axw5djw8qlx4gv7xw1ql0";
nativeBuildInputs = [ pkg-config ]
++ lib.optionals (withStableFeatures && stdenv.isLinux) [ python3 ];
buildInputs = [ openssl ]
++ lib.optionals stdenv.isDarwin [ zlib libiconv Security ]
++ lib.optionals (withStableFeatures && stdenv.isLinux) [ xorg.libX11 ]
++ lib.optionals (withStableFeatures && stdenv.isDarwin) [ AppKit ];
cargoBuildFlags = lib.optional withStableFeatures "--features stable";
checkPhase = ''
runHook preCheck
echo "Running cargo test"
HOME=$TMPDIR cargo test
runHook postCheck
'';
meta = with lib; {
description = "A modern shell written in Rust";
homepage = "https://www.nushell.sh/";
license = licenses.mit;
maintainers = with maintainers; [ Br1ght0ne johntitor marsam ];
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
};
passthru = {
shellPath = "/bin/nu";
};
}