mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-28 16:07:05 +00:00
flake: add Nix flake for reproducible builds (#1096)
Co-authored-by: loverustfs <hello@rustfs.com> Co-authored-by: 0xdx2 <xuedamon2@gmail.com>
This commit is contained in:
Generated
+27
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1765270179,
|
||||||
|
"narHash": "sha256-g2a4MhRKu4ymR4xwo+I+auTknXt/+j37Lnf0Mvfl1rE=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "677fbe97984e7af3175b6c121f3c39ee5c8d62c9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
# Nix flake for building RustFS
|
||||||
|
#
|
||||||
|
# Prerequisites:
|
||||||
|
# Install Nix: https://nixos.org/download/
|
||||||
|
# Enable flakes: https://nixos.wiki/wiki/Flakes#Enable_flakes
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# nix build # Build rustfs binary
|
||||||
|
# nix run # Build and run rustfs
|
||||||
|
# ./result/bin/rustfs --help
|
||||||
|
{
|
||||||
|
description = "RustFS - High-performance S3-compatible object storage";
|
||||||
|
|
||||||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{ nixpkgs, ... }:
|
||||||
|
let
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = forAllSystems (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
default = pkgs.rustPlatform.buildRustPackage {
|
||||||
|
pname = "rustfs";
|
||||||
|
version = "0.0.5";
|
||||||
|
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
pkg-config
|
||||||
|
protobuf
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [ openssl ];
|
||||||
|
|
||||||
|
cargoBuildFlags = [
|
||||||
|
"--package"
|
||||||
|
"rustfs"
|
||||||
|
];
|
||||||
|
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "High-performance S3-compatible object storage";
|
||||||
|
homepage = "https://rustfs.com";
|
||||||
|
license = pkgs.lib.licenses.asl20;
|
||||||
|
mainProgram = "rustfs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user