{"id":18465561,"url":"https://github.com/numtide/configure-nix-action","last_synced_at":"2025-04-08T08:31:57.927Z","repository":{"id":227486905,"uuid":"771477770","full_name":"numtide/configure-nix-action","owner":"numtide","description":"Configures Nix on GitHub Actions","archived":false,"fork":false,"pushed_at":"2024-10-04T00:52:24.000Z","size":17,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T23:55:51.175Z","etag":null,"topics":["github-actions","nix"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numtide.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-13T11:22:36.000Z","updated_at":"2024-09-17T20:50:41.000Z","dependencies_parsed_at":"2024-06-17T07:56:24.642Z","dependency_job_id":"a16e84cf-bc45-44c1-9bbe-3e83d8af0f5f","html_url":"https://github.com/numtide/configure-nix-action","commit_stats":null,"previous_names":["numtide/configure-nix-action"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fconfigure-nix-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fconfigure-nix-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fconfigure-nix-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fconfigure-nix-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numtide","download_url":"https://codeload.github.com/numtide/configure-nix-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804604,"owners_count":20999019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","nix"],"created_at":"2024-11-06T09:13:34.104Z","updated_at":"2025-04-08T08:31:57.673Z","avatar_url":"https://github.com/numtide.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# configure-nix-action\n\n![GitHub Actions badge](https://github.com/numtide/configure-nix-action/workflows/configure-nix-action%20test/badge.svg)\n\nConfigures [Nix](https://nixos.org/nix/) on GitHub Actions for the supported platforms: Linux and macOS.\n\n\u003e Draws heavily from [Install Nix Action](https://github.com/cachix/install-nix-action) and is intended for use with\nself-hosted [Github Action Runners](https://nix-community.github.io/srvos/github_actions_runner/). Once the kinks are \nsmoothed out this should be merged into cachix/install-nix-action.\n\nBy default it has no nixpkgs configured, you have to set `nix_path`\nby [picking a channel](https://status.nixos.org/)\nor [pin nixpkgs yourself](https://nix.dev/reference/pinning-nixpkgs)\n(see also [pinning tutorial](https://nix.dev/tutorials/towards-reproducibility-pinning-nixpkgs)).\n\n# Features\n\n- Allows specifying `$NIX_PATH` and channels via `nix_path`\n- Enables `flakes` and `nix-command` experimental features by default (to disable, set `experimental-features` via `extra_nix_config`)\n\n## Usage\n\nCreate `.github/workflows/test.yml` in your repo with the following contents:\n\n```yaml\nname: \"Test\"\non:\n  pull_request:\n  push:\njobs:\n  tests:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n    - uses: numtide/configure-nix-action@v1\n      with:\n        nix_path: nixpkgs=channel:nixos-unstable\n    - run: nix-build\n```\n\n## Usage with Flakes\n\n```yaml\nname: \"Test\"\non:\n  pull_request:\n  push:\njobs:\n  tests:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n    - uses: numtide/configure-nix-action@v1\n      with:\n        github_access_token: ${{ secrets.GITHUB_TOKEN }}\n    - run: nix build\n    - run: nix flake check\n```\n\nTo install Nix from any commit, go to [the corresponding installer_test action](https://github.com/NixOS/nix/runs/2219534360) and click on \"Run numtide/configure-nix-action@XX\" step and expand the first line.\n\n## Inputs (specify using `with:`)\n\n- `extra_nix_config`: append to `$HOME/.config/nix/nix.conf`\n\n- `github_access_token`: configure Nix to pull from GitHub using the given GitHub token. This helps work around rate limit issues. Has no effect when `access-tokens` is also specified in `extra_nix_config`.\n\n- `nix_path`: set `NIX_PATH` environment variable, for example `nixpkgs=channel:nixos-unstable`\n\n---\n\n## FAQ\n\n### How do I print nixpkgs version I have configured?\n\n```yaml\n- name: Print nixpkgs version\n  run: nix-instantiate --eval -E '(import \u003cnixpkgs\u003e {}).lib.version'\n```\n\n### How do I run NixOS tests?\n\nWith the following inputs:\n\n```yaml\n- uses: numtide/configure-nix-action@vXX\n  with:\n    extra_nix_config: \"system-features = nixos-test benchmark big-parallel kvm\"\n```\n\n### How do I install packages via nix-env from the specified `nix_path`?\n\n```\nnix-env -i mypackage -f '\u003cnixpkgs\u003e'\n```\n\n### How do I add a binary cache?\n\n```yaml\n- uses: numtide/configure-nix-action@v25\n  with:\n    extra_nix_config: |\n      trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\n      substituters = https://nix-community.cachix.org https://cache.nixos.org/\n```\n\n### How do I pass environment variables to commands run with `nix develop` or `nix shell`?\n\nNix runs commands in a restricted environment by default, called `pure mode`.\nIn pure mode, environment variables are not passed through to improve the reproducibility of the shell.\n\nYou can use the `--keep / -k` flag to keep certain environment variables:\n\n```yaml\n- name: Run a command with nix develop\n  run: nix develop --ignore-environment --keep MY_ENV_VAR --command echo $MY_ENV_VAR\n  env:\n    MY_ENV_VAR: \"hello world\"\n```\n\nOr you can disable pure mode entirely with the `--impure` flag:\n\n```\nnix develop --impure\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fconfigure-nix-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumtide%2Fconfigure-nix-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fconfigure-nix-action/lists"}