Skip to content

extra-sandbox-paths works on CLI but fails in config #4489

@rtburns-jpl

Description

@rtburns-jpl

Describe the bug

I'm trying to build packages with cuda support on non-NixOS, and run tests during the nix-build. This requires exposing nvidia GPU devices such as /dev/nvidia0 to the check phase, which I'm trying to achieve with extra-sandbox-paths. Oddly, specifying --option extra-sandbox-paths ... works on the command-line, but fails when I specify the same option in ~/.config/nix/nix.conf:

error: while setting up the build environment: getting attributes of path '"/dev/nvidia0"': No such file or directory

Steps To Reproduce

  • Works: nix-build '<nixpkgs>' -A hello --check --option extra-sandbox-paths "/dev/tty0"
  • Fails: nix-build '<nixpkgs>' -A hello --check with ~/.config/nix/nix.conf containing
    extra-sandbox-paths = "/dev/tty0"
    error: while setting up the build environment: getting attributes of path '"/dev/tty0"': No such file or directory

nix-env --version output
nix-env (Nix) 2.3.10

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