Merge pull request #248 from jennydaman/patch-1
Some checks failed
install-nix-action test / simple-build (ubuntu-latest) (push) Failing after 10s
install-nix-action test / custom-nix-path (ubuntu-latest) (push) Failing after 1s
install-nix-action test / extra-nix-config (ubuntu-latest) (push) Failing after 4s
install-nix-action test / flakes (ubuntu-latest) (push) Failing after 1s
install-nix-action test / latest-installer (ubuntu-latest, x86_64-linux) (push) Failing after 1s
install-nix-action test / oldest-supported-installer (ubuntu-latest) (push) Failing after 1s
install-nix-action test / act-support (ubuntu-latest) (push) Failing after 1s
install-nix-action test / simple-build (macos-13) (push) Has been cancelled
install-nix-action test / simple-build (macos-latest) (push) Has been cancelled
install-nix-action test / simple-build (ubuntu-24.04-arm) (push) Has been cancelled
install-nix-action test / custom-nix-path (macos-13) (push) Has been cancelled
install-nix-action test / custom-nix-path (macos-latest) (push) Has been cancelled
install-nix-action test / custom-nix-path (ubuntu-24.04-arm) (push) Has been cancelled
install-nix-action test / extra-nix-config (macos-13) (push) Has been cancelled
install-nix-action test / extra-nix-config (macos-latest) (push) Has been cancelled
install-nix-action test / extra-nix-config (ubuntu-24.04-arm) (push) Has been cancelled
install-nix-action test / flakes (macos-13) (push) Has been cancelled
install-nix-action test / flakes (macos-latest) (push) Has been cancelled
install-nix-action test / flakes (ubuntu-24.04-arm) (push) Has been cancelled
install-nix-action test / latest-installer (macos-13, x86_64-darwin) (push) Has been cancelled
install-nix-action test / latest-installer (macos-latest, aarch64-darwin) (push) Has been cancelled
install-nix-action test / latest-installer (ubuntu-24.04-arm, aarch64-linux) (push) Has been cancelled
install-nix-action test / oldest-supported-installer (macos-13) (push) Has been cancelled
install-nix-action test / oldest-supported-installer (macos-latest) (push) Has been cancelled
install-nix-action test / oldest-supported-installer (ubuntu-24.04-arm) (push) Has been cancelled

Suggestion: add example for `nix develop`
This commit is contained in:
sander 2025-08-19 17:44:32 +02:00 committed by GitHub
commit 9aaadd8b85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -155,6 +155,22 @@ install-nix-action's own `extra_nix_config` input:
substituters = https://hydra.iohk.io https://cache.nixos.org/
```
### How do I configure steps to use my flake's development environment?
You can configure [`jobs.<job_id>.steps[*].shell`](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepsshell)
to use `nix develop`.
```yaml
# (optional) pre-build the shell separately to avoid skewing the run time of the next
# step and have clear point of failure should the shell fail to build
- name: Pre-build devShell
run: nix build --no-link .#devShells.$(nix eval --impure --raw --expr 'builtins.currentSystem').default
- name: Run a command with nix develop
shell: 'nix develop -c bash -e {0}'
run: echo "hello, pure world!"
```
### How do I pass environment variables to commands run with `nix develop` or `nix shell`?
Nix runs commands in a restricted environment by default, called `pure mode`.