!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1162 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org188 Servers

Load older messages


SenderMessageTime
18 Nov 2025
@weethet:catgirl.cloudWeetHet
declare -x NIX_SSL_CERT_FILE="/private/tmp/2412pn9wp2vk7abqp0glq967n4/etc/ssl/certs/ca-certificates.crt"
declare -x SSL_CERT_FILE="/no-cert-file.crt"
22:28:42
@weethet:catgirl.cloudWeetHetHuh22:28:45
@reckenrode:matrix.orgRandy EckenrodeIs this Lix 2.94?22:29:29
@weethet:catgirl.cloudWeetHetYes22:30:22
@weethet:catgirl.cloudWeetHet But lix doesn't set SSL_CERT_FILE at all 22:30:34
@weethet:catgirl.cloudWeetHet It's nixpkgs/pkgs/stdenv/generic/setup.sh's fault 22:30:46
@weethet:catgirl.cloudWeetHet * It's pkgs/stdenv/generic/setup.sh's fault 22:30:51
@weethet:catgirl.cloudWeetHet
if [[ -z "${NIX_SSL_CERT_FILE:-}" && "${IN_NIX_SHELL:-}" != "impure" ]]; then
  export NIX_SSL_CERT_FILE=/no-cert-file.crt
fi
# Another variant left for compatibility.
if [[ -z "${SSL_CERT_FILE:-}" && "${IN_NIX_SHELL:-}" != "impure" ]]; then
  export SSL_CERT_FILE=/no-cert-file.crt
fi
22:30:59
@reckenrode:matrix.orgRandy Eckenrode

https://docs.lix.systems/manual/lix/stable/release-notes/rl-2.94.html

Global certificate authorities are copied inside the builder's environment gh#12698 fj#885 cl/3765

22:31:21
@weethet:catgirl.cloudWeetHet Yes, this sets NIX_SSL_CERT_FILE to a correct value 22:32:07
@reckenrode:matrix.orgRandy EckenrodeOh, is the issue that they’re different?22:32:54
@weethet:catgirl.cloudWeetHetYes22:33:14
@weethet:catgirl.cloudWeetHet Removing SSL_CERT_FILE and adding this to the profile fixes the FOD 22:33:55
@weethet:catgirl.cloudWeetHet
❯ nix-build -A default --log-format multiline-with-logs
/nix/store/6qf2pfw2l2zda78gy5fg38nhwa5db2vp-fetched-content
❯ cat $result
^C⏎
❯ cat ./result
{"status":"ok","method":"GET"}
22:35:25
@weethet:catgirl.cloudWeetHet *
❯ nix-build -A default --log-format multiline-with-logs
/nix/store/6qf2pfw2l2zda78gy5fg38nhwa5db2vp-fetched-content
❯ cat ./result
{"status":"ok","method":"GET"}
22:35:30
@weethet:catgirl.cloudWeetHet
{
  pkgs ? import <nixpkgs> { },
}:

let
  test-native = pkgs.rustPlatform.buildRustPackage {
    pname = "test-native";
    version = "0.1.0";

    src = pkgs.lib.fileset.toSource rec {
      root = ./.;
      fileset = pkgs.lib.fileset.unions (
        map (path: root + path) [
          "/Cargo.toml"
          "/Cargo.lock"
          "/src"
        ]
      );
    };

    cargoLock.lockFile = ./Cargo.lock;
  };

  fetchedContent = pkgs.stdenv.mkDerivation {
    name = "fetched-content";

    nativeBuildInputs = [ test-native ];

    outputHashMode = "flat";
    outputHashAlgo = "sha256";
    outputHash = "sha256-OmurRJs0zj+IxOTnQ2Cj4/HBzLQ2Zgs8lqi1S7J02Xo=";

    buildCommand = ''
      unset SSL_CERT_FILE
      test-native > $out
    '';

    env.RUST_BACKTRACE = 1;
  };

in
{
  inherit test-native fetchedContent;

  default = fetchedContent;
}
22:35:42
@weethet:catgirl.cloudWeetHet

Yeah, without unset SSL_CERT_FILE it fails even without sandbox:

❯ nix-build -A default --log-format multiline-with-logs --option sandbox false
this derivation will be built:
  /nix/store/m2cc2n43cr6gyn3gbkx094c27kjzrhnv-fetched-content.drv
building '/nix/store/m2cc2n43cr6gyn3gbkx094c27kjzrhnv-fetched-content.drv'...
fetched-content> Error: reqwest::Error { kind: Request, url: "https://dummyjson.com/test", source: hyper_util::client::legacy::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidCertificate(UnknownIssuer) } }) }
error: builder for '/nix/store/m2cc2n43cr6gyn3gbkx094c27kjzrhnv-fetched-content.drv' failed with exit code 1;
       last 1 log lines:
       > Error: reqwest::Error { kind: Request, url: "https://dummyjson.com/test", source: hyper_util::client::legacy::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidCertificate(UnknownIssuer) } }) }
       For full logs, run:
               nix-store -l /nix/store/m2cc2n43cr6gyn3gbkx094c27kjzrhnv-fetched-content.drv
22:37:48
@weethet:catgirl.cloudWeetHetAt least native certs are fixed22:44:38
@weethet:catgirl.cloudWeetHetYippee.png22:45:08
@reckenrode:matrix.orgRandy EckenrodeI really hate LLVM’s command-line parsing.23:41:31
19 Nov 2025
@d:metropolis.nexusdave :3 joined the room.00:21:21
@weethet:catgirl.cloudWeetHet

I don't understand the purpose of
https://github.com/NixOS/nixpkgs/blob/0157c02bf5c109b712e8373e21b516828ca3bed5/pkgs/stdenv/generic/setup.sh#L997-L1005

# Prevent SSL libraries from using certificates in /etc/ssl, unless set explicitly.
# Leave it in impure shells for convenience.
if [[ -z "${NIX_SSL_CERT_FILE:-}" && "${IN_NIX_SHELL:-}" != "impure" ]]; then
  export NIX_SSL_CERT_FILE=/no-cert-file.crt
fi
# Another variant left for compatibility.
if [[ -z "${SSL_CERT_FILE:-}" && "${IN_NIX_SHELL:-}" != "impure" ]]; then
  export SSL_CERT_FILE=/no-cert-file.crt
fi

We have sandbox to ensure that people use exactly what we provide to them, can these lines just be removed?

10:25:35
@weethet:catgirl.cloudWeetHet

This seems to originate from here: https://github.com/NixOS/nixpkgs/commit/788da6894fac5b20d183ce5afbab3bacd7ddeaca

And was there before we actually had NIX_SSL_CERT_FILE

10:35:15
@weethet:catgirl.cloudWeetHet At least I think SSL_CERT_FILE should just not be tampered with 10:35:52
@weethet:catgirl.cloudWeetHetBecause it's something not-nix related in all cases10:36:09
@toonn:matrix.orgtoonn Is the sandbox enabled by default? 10:38:40
@weethet:catgirl.cloudWeetHetFor FODs no10:40:40
@weethet:catgirl.cloudWeetHetFor non-FODs also no10:40:48
@weethet:catgirl.cloudWeetHetI think10:41:00
@weethet:catgirl.cloudWeetHetBut why does it matter what happens when sandbox is disabled. If it's disabled all guarantees are off anyways 10:41:42

Show newer messages


Back to Room ListRoom Version: 6