Error building flake in container on circleci

I am getting an error running ‘nix build’. This builds inside a container in circleci. Running the same build in the container locally works just fine. In the same container on circleci it gives the following error:

I am not sure how to debug this given the lack of information.

#!/bin/bash -eo pipefail nix run

trace: warning: `buildRustCrate` is deprecated, use `buildRustCrateForPkgs` instead error: cannot set host name: Operation not permitted (use '--show-trace' to show detailed location information) Exited with code exit status 1

CircleCI received exit code 1

For posterity (and thanks to GitHub - johannesloetzsch/nix-docker-cljc: reproducible dev+test+production environments for java+javascript+clojure(script)):

Circleci requires that nix builds run without sandboxing , otherwise it fails with „ cannot set host name: Operation not permitted “. So we disable it by setting sandbox = false in ~/.config/nix/nix.conf .

2 Likes