Skip to content

Flake: nixConfig options don't get used by nix run #6170

@Kranzes

Description

@Kranzes

Describe the bug

When using nix run, the command does not use the nixConfig options declared in the flake.nix. nix build does read it accordingly.

For example when using nixConfig.extra-substituters with nix run the build process won't use the binary cache, but when using nix build it does.

Steps To Reproduce

  1. Execute nix run github:AmitHalpert/contamination
  2. ^ binary cache is not used ^
  3. Execute nix run github:AmitHalpert/contamination \ --option extra-substituters 'https://contamination.cachix.org/' \ --option extra-trusted-public-keys 'contamination.cachix.org-1:KmdW5xVF8ccKEb9tvK6qtEMW+lGa83seGgFyBOkeM/4='
  4. ^ binary is being used ^
  5. Execute nix build github:AmitHalpert/contamination (binary cache is used and the options are prompted when running)

Expected behavior
When executing nix run on a flake with the nixConfig options set I expect nix run to read those options and use them accordingly.

nix-env --version output
nix-env (Nix) 2.7.0pre20220127_558c4ee

Metadata

Metadata

Assignees

No one assigned

    Labels

    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