Skip to content

Conversation

@Mic92
Copy link
Contributor

@Mic92 Mic92 commented Dec 10, 2025

Enable building rustfs with Nix package manager.
It allows using rustfs on x86_64-linux, aarch64-linux, x86_64-darwin, and aarch64-darwin. Upstream (nixpkgs) can later adopt this package definition to provide cached builds for users of Nix.

The next step is to add a NixOS module. I have a stub one already in my niks3 binary cache that I use for testing that would need some love to be upstream-worthy (i.g. I hard-code s3 credentials)

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

Summary of Changes

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (compatibility)
  • Requires doc/config/deployment update
  • Other impact:

Additional Notes


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

Enable building rustfs with Nix package manager.
It allows using rustfs on x86_64-linux, aarch64-linux, x86_64-darwin, and aarch64-darwin.
Upstream (nixpkgs) can later adopt this package definition to provide
cached builds for users of Nix.

The next step is to add a NixOS module. I have a stub one already
in my niks3 binary cache that I use for [testing](https://github.com/Mic92/niks3/blob/8fbef7d5a3d551d0f1dc663fe91f94c3e3edf85e/nix/checks/nixos-test-niks3.nix)
that would need some love to be upstream-worthy (i.g. I hard-code s3 credentials)
@Mic92 Mic92 mentioned this pull request Dec 10, 2025
15 tasks
@Mic92
Copy link
Contributor Author

Mic92 commented Dec 10, 2025

waiting for all builds on all systems to finish.

@loverustfs
Copy link
Contributor

Hey @Mic92 ,
NixOS is a great product!
Thank you for your contributions to open source worldwide!

@Mic92
Copy link
Contributor Author

Mic92 commented Dec 10, 2025

I tested this on:

  • x86_64-linux
  • aarch64-linux
  • aarch64-darwin

What scope of NixOS integration do you want to have?
The next steps could be:

  • a quick start section for using the nix package
  • a NixOS module to run the systemd service on NixOS
  • CI integration for building the rustfs packages, potentially with a binary cache so that people can download pre-cached binaries
  • A NixOS integration VM test that can be also run CI that test the NixOS integration e2e.

@Mic92 Mic92 marked this pull request as ready for review December 10, 2025 12:00
@loverustfs
Copy link
Contributor

Hey @Mic92 ,

Our goal is simply to allow NixOS users to get RustFS (SNSD) up and running quickly.

For advanced RustFS needs, we prefer to direct users to consult experts like you for commercial support. I believe that is the most reasonable approach.

However, if you have a better suggestion, we would value your professional advice on this.

Thank you!

@Mic92 Mic92 mentioned this pull request Dec 10, 2025
15 tasks
@Mic92
Copy link
Contributor Author

Mic92 commented Dec 10, 2025

Hey @Mic92 ,

Our goal is simply to allow NixOS users to get RustFS (SNSD) up and running quickly.

For advanced RustFS needs, we prefer to direct users to consult experts like you for commercial support. I believe that is the most reasonable approach.

However, if you have a better suggestion, we would value your professional advice on this.

Thank you!

I split the docs out into a separate PR, so details can be discussed here: #1103
We will get back to you regarding commercial support.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Nix flake support to enable reproducible builds of RustFS across multiple platforms (x86_64-linux, aarch64-linux, x86_64-darwin, and aarch64-darwin). The implementation provides a standard Nix package definition that can be integrated into nixpkgs for cached binary distribution to Nix users.

Key Changes:

  • Adds flake.nix with complete build configuration using Rust Platform
  • Includes properly configured dependencies (protobuf, pkg-config, openssl)
  • Provides flake.lock pinning nixpkgs to a recent unstable snapshot

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
flake.nix Defines Nix flake with rustPlatform.buildRustPackage configuration, supporting 4 platform architectures with appropriate build dependencies and metadata
flake.lock Locks nixpkgs-unstable dependency to a specific revision (Dec 9, 2025) for reproducible builds

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"rustfs"
];

doCheck = false;
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are disabled during the Nix build with doCheck = false. Since the project has comprehensive test coverage across multiple crates, consider enabling tests in the Nix build. If tests are disabled due to specific requirements (e.g., external dependencies, network access, or long build times), this should be documented in a comment explaining the rationale.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants