Skip to content

NIX_SSL_CERT_FILE unreadable on darwin with sandbox enabled #12698

Open
@TomaSajt

Description

@TomaSajt

Describe the bug

NIX_SSL_CERT_FILE seems to be unreadable on Darwin systems with sandboxing enabled.

This breaks many things in nixpkgs, e.g. fetchgit and rustPlatform.fetchCargoVendor

fetchCargoVendor failure: NixOS/nixpkgs#385366
fetchgit failure: NixOS/nixpkgs#385366 (comment)

Steps To Reproduce

Could someone with an actual darwin machine confirm this? Thanks :)

I think this is how you reproduce it

  1. install nix on a Darwin system
  2. have sandboxing enabled
  3. in a FOD derivation, have impureEnvVars = lib.fetchers.proxyImpureEnvVars (a list that contains NIX_SSL_CERT_FILE among others)
  4. in the FOD's build script do the following:
    4.1. make sure $NIX_SSL_CERT_FILE is actually set to the proper value instead of the fallback /no-cert-file.crt value
    4.2. do cat "$NIX_SSL_CERT_FILE"
  5. get a permission error (which I'm assuming means that it is blocked by the sandbox)

Additional context

Using a relaxed sandbox seems to work fine.

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions