cachix / install-nix-action

Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.
Apache License 2.0
513 stars 79 forks source link

Env var not passed down the nix develop command #149

Closed soywod closed 1 year ago

soywod commented 1 year ago

I have a step that publishes my node lib to NPM:

      - name: Publishes the lib
        working-directory: lib
        run: nix develop -c yarn publish --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

This command fails because yarn publish cannot find the NODE_AUTH_TOKEN env var. If I remove the nix develop -c it works as expected, but I would prefer using the node version packed with nix. Any idea on how to deal with this?

Alizter commented 1 year ago

Does passing -k NODE_AUTH_TOKEN to nix develop fix it?

l0b0 commented 1 year ago

Is this a cachix issue? Could this be closed?

Alizter commented 1 year ago

Maybe with some documentation about the issue it can be closed.

sandydoo commented 1 year ago

Does --keep / -k work with nix develop? It requires adding the --ignore-environment flag, which then completely breaks the shell for me.

nix develop --impure definitely works though.