From 10246893188f6aff33a251f7febdf04a3c4e5b8b Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sat, 9 Nov 2019 04:20:00 -0500 Subject: [PATCH 1/2] nushell: init at 0.5.0 --- pkgs/shells/nushell/default.nix | 42 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 46 insertions(+) create mode 100644 pkgs/shells/nushell/default.nix diff --git a/pkgs/shells/nushell/default.nix b/pkgs/shells/nushell/default.nix new file mode 100644 index 00000000000..6e075b7ceee --- /dev/null +++ b/pkgs/shells/nushell/default.nix @@ -0,0 +1,42 @@ +{ stdenv +, fetchFromGitHub +, rustPlatform +, openssl +, pkg-config +, libiconv +, Security +}: + +rustPlatform.buildRustPackage rec { + pname = "nushell"; + version = "0.5.0"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "0_5_0"; + sha256 = "1s60w29c8sv0a4nmpggls9pkqyfrwwxjzd65p68d1xxxsdb36rzj"; + }; + + cargoSha256 = "0b8alc3si6y4xmn812izknbkfkz64kz7kcnq4xaqws6iqn7pqidp"; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = stdenv.lib.optionals stdenv.isLinux [ openssl ] + ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ]; + + preCheck = '' + export HOME=$TMPDIR + ''; + + meta = with stdenv.lib; { + description = "A modern shell written in Rust"; + homepage = "https://www.nushell.sh/"; + license = licenses.mit; + maintainers = [ maintainers.marsam ]; + }; + + passthru = { + shellPath = "/bin/nu"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b02908feea8..71910a31637 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16568,6 +16568,10 @@ in musl = callPackage ../os-specific/linux/musl { }; + nushell = callPackage ../shells/nushell { + inherit (darwin.apple_sdk.frameworks) Security; + }; + nettools = if stdenv.isLinux then callPackage ../os-specific/linux/net-tools { } else unixtools.nettools; From a8942c6cbd737c4ce989caab5a5ae2a05b9a5d43 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Tue, 12 Nov 2019 04:20:00 -0500 Subject: [PATCH 2/2] nushell: add withAllFeatures flag Co-authored-by: Evan Stoll --- pkgs/shells/nushell/default.nix | 13 +++++++++++-- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/shells/nushell/default.nix b/pkgs/shells/nushell/default.nix index 6e075b7ceee..91684504774 100644 --- a/pkgs/shells/nushell/default.nix +++ b/pkgs/shells/nushell/default.nix @@ -3,8 +3,12 @@ , rustPlatform , openssl , pkg-config +, python3 +, xorg , libiconv +, AppKit , Security +, withAllFeatures ? true }: rustPlatform.buildRustPackage rec { @@ -20,10 +24,15 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "0b8alc3si6y4xmn812izknbkfkz64kz7kcnq4xaqws6iqn7pqidp"; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config ] + ++ stdenv.lib.optionals (withAllFeatures && stdenv.isLinux) [ python3 ]; buildInputs = stdenv.lib.optionals stdenv.isLinux [ openssl ] - ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ]; + ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ] + ++ stdenv.lib.optionals (withAllFeatures && stdenv.isLinux) [ xorg.libX11 ] + ++ stdenv.lib.optionals (withAllFeatures && stdenv.isDarwin) [ AppKit ]; + + cargoBuildFlags = stdenv.lib.optionals withAllFeatures [ "--features" "all" ]; preCheck = '' export HOME=$TMPDIR diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 71910a31637..f267e3f743f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16569,7 +16569,7 @@ in musl = callPackage ../os-specific/linux/musl { }; nushell = callPackage ../shells/nushell { - inherit (darwin.apple_sdk.frameworks) Security; + inherit (darwin.apple_sdk.frameworks) AppKit Security; }; nettools = if stdenv.isLinux then callPackage ../os-specific/linux/net-tools { }