Skip to content

nix run github:rustfs/rustfs fails on macOS (darwin) due to removed darwin.apple_sdk API in nixpkgs #1883

Description

@etak64n

Summary

nix run github:rustfs/rustfs fails on macOS (aarch64-darwin / x86_64-darwin) because flake.nix references pkgs.darwin.apple_sdk.frameworks.Security and pkgs.darwin.apple_sdk.frameworks.SystemConfiguration, which have been removed from nixpkgs.

Environment

  • OS: macOS 15.x (aarch64-darwin)
  • Nix: 2.33.3
  • RustFS: 0.0.5 (flake revision: 583377d2a5b458beb5043495e4b38f642a36f23a)
  • nixpkgs: 2343bbb58f99267223bc2aac4fc9ea301a155a16 (2026-02-11, nixpkgs-unstable)

Steps to Reproduce

  1. Run the following command on macOS:

    nix run github:rustfs/rustfs
  2. The build fails during Nix evaluation with the following error:

    error:
           … while calling the 'derivationStrict' builtin
             at «nix-internal»/derivation-internal.nix:37:12:
               36|
               37|   strict = derivationStrict drvAttrs;
                 |            ^
               38|
    
           … while evaluating derivation 'rustfs-0.0.5'
             whose name attribute is located at
             «github:NixOS/nixpkgs/2343bbb58f99267223bc2aac4fc9ea301a155a16
             ?narHash=sha256-LovWTGDwXhkfCOmbgLVA10bvsi/P8eDDpRudgk68HA8%3D»
             /pkgs/stdenv/generic/make-derivation.nix:536:13
    
           … while evaluating attribute '__impureHostDeps' of derivation 'rustfs-0.0.5'
             at «github:NixOS/nixpkgs/2343bbb58f99267223bc2aac4fc9ea301a155a16
             ?narHash=sha256-LovWTGDwXhkfCOmbgLVA10bvsi/P8eDDpRudgk68HA8%3D»
             /pkgs/stdenv/generic/make-derivation.nix:688:15:
              687|               );
              688|               __impureHostDeps =
                 |               ^
              689|                 computedImpureHostDeps
    
           (stack trace truncated; use '--show-trace' to show the full, detailed trace)
    
           error: darwin.apple_sdk_11_0 has been removed as it was a legacy
           compatibility stub; see
           <https://nixos.org/manual/nixpkgs/stable/#sec-darwin-legacy-frameworks>
           for migration instructions
    

Expected Behavior

RustFS should build and start successfully on macOS via nix run.

Actual Behavior

The build fails during Nix evaluation before compilation begins. This affects both packages.default and devShells.default.

What I Tried

  • Pinning nixpkgs to nixos-25.05 via --override-input:
    • Result: Build succeeds with deprecation warnings
    • This confirms the issue is specific to the nixpkgs revision pinned in flake.lock
    nix run github:rustfs/rustfs \
      --override-input nixpkgs github:NixOS/nixpkgs/nixos-25.05
  • Removing darwin.apple_sdk.frameworks.* from buildInputs locally:
    • Result: Not tested (would require forking the repo)

Root Cause

The flake.nix references pkgs.darwin.apple_sdk.frameworks.Security and pkgs.darwin.apple_sdk.frameworks.SystemConfiguration in buildInputs:

https://github.com/rustfs/rustfs/blob/583377d/flake.nix

buildInputs = with pkgs; [
  openssl
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
  pkgs.darwin.apple_sdk.frameworks.Security
  pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
];

nixpkgs has replaced darwin.apple_sdk with a throw expression in pkgs/top-level/darwin-aliases.nix (NixOS/nixpkgs#346043):

apple_sdk = apple_sdk_11_0;
apple_sdk_11_0 = mkThrow "apple_sdk_11_0";

The flake.lock pins nixpkgs to 2343bbb (2026-02-11), which is after this removal. On nixpkgs 25.05, the stubs still exist but print deprecation warnings. On the current nixpkgs-unstable, they throw.

Tracking issue for the Darwin SDK migration: NixOS/nixpkgs#354146

Suggested Fix

Remove the explicit framework references from buildInputs. The new Darwin stdenv includes all standard frameworks (Security, SystemConfiguration, etc.) by default via $SDKROOT. Rust crates that link against these frameworks via -framework linker flags will work without explicit buildInputs.

 buildInputs = with pkgs; [
   openssl
-] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
-  pkgs.darwin.apple_sdk.frameworks.Security
-  pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
 ];

This change is needed in both packages.default and devShells.default.

If a specific SDK version is required, the new API is:

buildInputs = with pkgs; [
  openssl
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
  pkgs.apple-sdk_11
];

I can submit a PR if this approach looks correct.

Workaround

Until this is fixed, users can pin nixpkgs to nixos-25.05:

nix run github:rustfs/rustfs \
  --override-input nixpkgs github:NixOS/nixpkgs/nixos-25.05

This produces deprecation warnings but builds successfully.

References

Metadata

Metadata

Assignees

Labels

S-reproducingStatus: Reproducing a bug report

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions