{"id":14968088,"url":"https://github.com/yaxitech/nix-install-pkgs-action","last_synced_at":"2025-10-26T00:31:01.220Z","repository":{"id":39653341,"uuid":"356568246","full_name":"yaxitech/nix-install-pkgs-action","owner":"yaxitech","description":"A GitHub Action to install flake packages using an ephemeral Nix profile","archived":false,"fork":false,"pushed_at":"2024-11-08T17:11:07.000Z","size":1160,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-31T12:51:22.981Z","etag":null,"topics":["actions","nix"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/yaxitech.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":"2021-04-10T12:00:22.000Z","updated_at":"2024-11-08T17:49:12.000Z","dependencies_parsed_at":"2024-05-02T12:59:17.115Z","dependency_job_id":"94c3fe39-b5a8-45e7-8827-7492c36c60ca","html_url":"https://github.com/yaxitech/nix-install-pkgs-action","commit_stats":{"total_commits":51,"total_committers":5,"mean_commits":10.2,"dds":0.4901960784313726,"last_synced_commit":"c6b10538f2e15d549d96a53704e6fc3f1b9c226b"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaxitech%2Fnix-install-pkgs-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaxitech%2Fnix-install-pkgs-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaxitech%2Fnix-install-pkgs-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaxitech%2Fnix-install-pkgs-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaxitech","download_url":"https://codeload.github.com/yaxitech/nix-install-pkgs-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238229940,"owners_count":19437723,"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":["actions","nix"],"created_at":"2024-09-24T13:39:14.394Z","updated_at":"2025-10-26T00:31:01.214Z","avatar_url":"https://github.com/yaxitech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nix-install-pkgs-action\n\n![Coverage](https://github.com/yaxitech/nix-install-pkgs-action/blob/gh-pages/coverage.svg)\n\nA GitHub Action to install [Nix][nixos] packages into an ephemeral profile.\n\nThe action is particularly useful if you use a self-hosted [GitHub Actions Runner\non NixOS][nixos-runner]. Third-party actions frequently require certain tools to be installed\nwhich are by default not available to the runner. With this action, you can install\nNix packages easily making them available to following actions.\n\nAs soon as the action terminates—no matter if successfully or unsuccessfully—the profile is purged to\nallow garbage collection of all installed derivations.\n\n[nixos]: https://nixos.org\n[nixos-runner]: https://search.nixos.org/options?channel=unstable\u0026query=services.github-runner.\n\n## Usage\n\nThe action supports installing derivations from Flake packages and by evaluating a given expression.\nInstallation happens through `nix profile`.\n\nYou may call this action multiple times within the same job. Following steps will reuse the profile.\nThe path of the profile is also available with the step output `nix_profile_path`.\n\n### Packages\n\nInstall `packages` by giving a comma-separated string of packages from a flake.\nIf no flake reference is given, `nixpkgs` is assumed. Example:\n\n```yaml\nname: 'nix-install-pkgs-action packages'\non:\n  - pull_request\n  - push\njobs:\n  tests:\n    runs-on: self-hosted\n    steps:\n      - uses: actions/checkout@v4\n      - uses: yaxitech/nix-install-pkgs-action@v7\n        with:\n          packages: \"nixpkgs#hello, figlet\"\n      - run: |\n          hello\n          figlet \"Hello nix-install-pkgs-action!\"\n\n```\n\nWhen installing flakes which reference a registry entry, the action resolves them as follows:\n\n- If the input `inputs-from` is given, the action invokes `nix profile install --inputs-from`.\n   As a result, `nixpkgs#hello` will look up `nixpkgs` using the inputs of the flake given in\n   `inputs-from`.\n- `inputs-from` defaults to `.`, i.e., the current working directory of the process. If this\n   directory (or a parent) contains a valid flake, `nix profile install` is invoked with this\n   flake.\n- If `inputs-from` is unset (i.e., `\"\"`), `nix profile` resolves tokens using the registry.\n\n### Expressions\n\nOn some occasions, you need to compose a custom derivation from a Nix expression, for example,\nto install Python 3 with specific packages. This can be done with the `expr` input.\nThe action evaluates the passed string through `nix profile install --expr`.\nWithin your expression, the actions provides an imported `nixpkgs` as `pkgs` using the same\nresolution strategy as outlined for the `packages` input.\nIn the following example, `pkgs` references `inputs.nixpkgs` from the flake `github:yaxitech/ragenix`:\n\n```yaml\nname: 'nix-install-pkgs-action expr'\non:\n  - pull_request\n  - push\njobs:\n  tests:\n    runs-on: self-hosted\n    steps:\n      - uses: actions/checkout@v4\n      - uses: yaxitech/nix-install-pkgs-action@v7\n        with:\n          expr: 'pkgs.python3.withPackages(ps: with ps; [toml pyyaml])'\n          inputs-from: 'github:yaxitech/ragenix'\n      - run: |\n          python3 ...\n```\n\nWithin your expression, the action also introduces `let` bindings for a flake in the current\nworking directory (`repoFlake`) and for the flake referenced by `inputs-from` (`inputsFromFlake`).\n\n### Unfree nixpkgs packages\n\nTo install `nixpkgs` packages with an unfree license, either through `packages` or `expr`,\nset the input `allow-unfree` to `true`. Note that this will only allow installing unfree packages\nfrom `nixpkgs`. If a flake uses an unfree license you're on your own.\n\n### Dummy binaries\n\nSometimes, a GitHub action will check whether certain binaries are in the `$PATH` environment variable\nbefore running the action, even if the binary will not actually be executed as part of your workflow configuration.\nTo satisfy these workflows, the `dummy-bins` input accepts a list of binary names that will be installed\nas executables.\n\n## Prerequisites\n\nThis action requires a Flake-enabled Nix with support for\n[profiles](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-profile.html).\n\n### NixOS\n\n```nix\n{\n  nix.settings.experimental-features = [ \"nix-command\" \"flakes\" ];\n}\n```\n\n### Non-NixOS\n\nUse [`cachix/install-nix-action`](https://github.com/cachix/install-nix-action#usage-with-flakes)\nto install Nix with flake support.\n\n## Development notes\n\nAfter you changed `package.json`, you also need to update `npmDepsHash` in `flake.nix`.\nYou can acquire the hash by running: `nix develop -c prefetch-npm-deps package-lock.json`.\n\nSome of the TypeScript tests invoke `nix` during test execution. That means if\nyou invoke the tests through `nix`, for example as part of `nix build`, a nix\nthat has the `recursive-nix` feature enabled is required. You can put the\nfollowing snippet into your `configuration.nix`:\n\n```nix\n{\n  nix.settings = {\n    experimental-features = [ \"nix-command\" \"flakes\" \"recursive-nix\" ];\n    system-features = [ \"recursive-nix\" ];\n  };\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaxitech%2Fnix-install-pkgs-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaxitech%2Fnix-install-pkgs-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaxitech%2Fnix-install-pkgs-action/lists"}