ci: optimize and translate nix workflow (#1821)

This commit is contained in:
houseme
2026-02-15 00:37:57 +08:00
committed by GitHub
parent 8512a38f68
commit 1554e7e76a
2 changed files with 124 additions and 5 deletions
+40 -5
View File
@@ -11,10 +11,21 @@
{
description = "RustFS - High-performance S3-compatible object storage";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, ... }:
{
self,
nixpkgs,
rust-overlay,
...
}:
let
systems = [
"x86_64-linux"
@@ -28,10 +39,26 @@
packages = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
# Use the latest stable rust toolchain
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [
"rust-src"
"rust-analyzer"
"clippy"
"rustfmt"
];
};
rustPlatform = pkgs.makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
};
in
{
default = pkgs.rustPlatform.buildRustPackage {
default = rustPlatform.buildRustPackage {
pname = "rustfs";
version = "0.0.5";
@@ -47,13 +74,21 @@
protobuf
];
buildInputs = with pkgs; [ openssl ];
buildInputs = with pkgs; [
openssl
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
];
cargoBuildFlags = [
"--package"
"rustfs"
];
# Set environment variables for build
PROTOC = "${pkgs.protobuf}/bin/protoc";
doCheck = false;
meta = {