mirror of
https://github.com/nushell/nushell.git
synced 2026-11-25 11:06:52 +08:00
## Description Remove `x86_64-darwin` (Intel Mac) from the Nix flake's supported systems because nixos-unstable after 26.05 has dropped support for this platform, causing evaluation to fail. This removes Intel Mac outputs from `packages`, `legacyPackages`, and `devShells`. Apple Silicon Mac support remains available through `aarch64-darwin`. Also update `flake.lock` to refresh the `nixpkgs` and `rust-overlay` inputs. ## User-facing changes (Release notes) Removed Intel Mac (`x86_64-darwin`) support from the Nushell Nix flake following its removal from upstream Nixpkgs. Apple Silicon Macs remain supported.
192 lines
5.4 KiB
Nix
192 lines
5.4 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
rust-overlay = {
|
|
url = "github:oxalica/rust-overlay";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
inputs:
|
|
let
|
|
inherit (inputs.nixpkgs) lib;
|
|
# systems = lib.systems.flakeExposed;
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"powerpc64le-linux"
|
|
"aarch64-darwin"
|
|
"riscv64-linux"
|
|
"armv6l-linux"
|
|
"armv7l-linux"
|
|
"i686-linux"
|
|
## Broken in `nix flake check`
|
|
# "x86_64-freebsd"
|
|
];
|
|
main-overlay = final: previous: {
|
|
# Override the rustPlatform without forcing a rebuild of _every_ tool as well
|
|
rustToolchain' = previous.rust-bin.fromRustupToolchainFile ../../rust-toolchain.toml;
|
|
rustPlatform' = final.makeRustPlatform {
|
|
cargo = final.rustToolchain';
|
|
rustc = final.rustToolchain';
|
|
};
|
|
# Add a specific rustPlatform with extensions for development/editors
|
|
rustToolchain-devshell = final.rustToolchain'.override ({
|
|
extensions = [
|
|
"rust-src"
|
|
"rust-analyzer"
|
|
];
|
|
});
|
|
rustPlatform-devshell = final.makeRustPlatform {
|
|
cargo = final.rustToolchain-devshell;
|
|
rustc = final.rustToolchain-devshell;
|
|
};
|
|
rustToolchain-latest-devshell = previous.rust-bin.stable.latest.default.override ({
|
|
extensions = [
|
|
"rust-src"
|
|
"rust-analyzer"
|
|
];
|
|
});
|
|
rustPlatform-latest-devshell = final.makeRustPlatform {
|
|
cargo = final.rustToolchain-latest-devshell;
|
|
rustc = final.rustToolchain-latest-devshell;
|
|
};
|
|
nushell = previous.callPackage ./. {
|
|
rustPlatform = final.rustPlatform';
|
|
};
|
|
nushellPlugins =
|
|
previous.nushellPlugins
|
|
// (builtins.mapAttrs
|
|
(
|
|
pname: d:
|
|
previous.callPackage ./. (
|
|
{
|
|
pname = "nu_plugin_${pname}";
|
|
rustPlatform = final.rustPlatform';
|
|
extraCargo = ../../crates + "/nu_plugin_${pname}/Cargo.toml";
|
|
buildAndTestSubdir = "crates/nu_plugin_${pname}";
|
|
nativeBuildInputs = [
|
|
previous.pkg-config
|
|
]
|
|
++ lib.optionals previous.stdenv.cc.isClang [ final.rustPlatform'.bindgenHook ]
|
|
++ (d.extraNativeBuildInputs or [ ]);
|
|
}
|
|
// d
|
|
)
|
|
)
|
|
{
|
|
formats = { };
|
|
gstat = {
|
|
buildInputs = [ previous.openssl ];
|
|
};
|
|
inc = { };
|
|
polars = {
|
|
buildInputs = [ previous.openssl ];
|
|
checkFlags = [
|
|
"--skip=dataframe::command::core::to_repr::test::test_examples"
|
|
];
|
|
};
|
|
query = {
|
|
buildInputs = [
|
|
previous.openssl
|
|
previous.curlMinimal
|
|
];
|
|
};
|
|
}
|
|
);
|
|
};
|
|
forEachSupportedSystem =
|
|
f:
|
|
inputs.nixpkgs.lib.genAttrs systems (
|
|
system:
|
|
f {
|
|
pkgs = import inputs.nixpkgs {
|
|
inherit system;
|
|
overlays = [
|
|
inputs.rust-overlay.overlays.default
|
|
main-overlay
|
|
];
|
|
};
|
|
}
|
|
);
|
|
in
|
|
{
|
|
overlays = {
|
|
default = main-overlay;
|
|
};
|
|
packages = forEachSupportedSystem (
|
|
{ pkgs, ... }:
|
|
{
|
|
inherit (pkgs) nushell;
|
|
default = pkgs.nushell;
|
|
dev = pkgs.nushell.override {
|
|
buildType = "dev";
|
|
};
|
|
}
|
|
);
|
|
legacyPackages = forEachSupportedSystem (
|
|
{ pkgs, ... }:
|
|
{
|
|
nushellPlugins = {
|
|
# Only getting a subset of these so we don't have _all_ of the
|
|
# plugins that are in `nixpkgs`
|
|
inherit (pkgs.nushellPlugins)
|
|
formats
|
|
gstat
|
|
inc
|
|
polars
|
|
query
|
|
;
|
|
};
|
|
}
|
|
);
|
|
devShells = forEachSupportedSystem (
|
|
{ pkgs, ... }:
|
|
let
|
|
basepkgs =
|
|
with pkgs;
|
|
(
|
|
[
|
|
curlMinimal
|
|
openssl
|
|
pkg-config
|
|
zstd
|
|
]
|
|
++ (lib.optionals stdenv.hostPlatform.isLinux [
|
|
python3
|
|
libX11
|
|
])
|
|
++ (lib.optionals stdenv.hostPlatform.isDarwin [
|
|
zlib
|
|
nghttp2
|
|
libgit2
|
|
])
|
|
);
|
|
in
|
|
{
|
|
# devshell with build/check deps from nushell and plugins, with some
|
|
# separation for linux/darwin.
|
|
default = pkgs.mkShell {
|
|
packages =
|
|
with pkgs;
|
|
[
|
|
rustToolchain-devshell
|
|
rustPlatform-devshell.bindgenHook
|
|
]
|
|
++ basepkgs;
|
|
};
|
|
latest = pkgs.mkShell {
|
|
packages =
|
|
with pkgs;
|
|
[
|
|
rustToolchain-latest-devshell
|
|
rustPlatform-latest-devshell.bindgenHook
|
|
]
|
|
++ basepkgs;
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|