Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: nixpkgs_flake_package #380

Merged
merged 5 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 170 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ See [examples](/examples/toolchains) for how to use `rules_nixpkgs` with differe
* [nixpkgs_http_repository](#nixpkgs_http_repository)
* [nixpkgs_local_repository](#nixpkgs_local_repository)
* [nixpkgs_package](#nixpkgs_package)
* [nixpkgs_flake_package](#nixpkgs_flake_package)
* [nixpkgs_cc_configure](#nixpkgs_cc_configure)
* [nixpkgs_cc_configure_deprecated](#nixpkgs_cc_configure_deprecated)
* [nixpkgs_java_configure](#nixpkgs_java_configure)
Expand Down Expand Up @@ -517,6 +518,174 @@ Options to forward to the nix command.
</table>


<a id="#nixpkgs_flake_package"></a>

### nixpkgs_flake_package

<pre>
nixpkgs_flake_package(<a href="#nixpkgs_flake_package-name">name</a>, <a href="#nixpkgs_flake_package-nix_flake_file">nix_flake_file</a>, <a href="#nixpkgs_flake_package-nix_flake_lock_file">nix_flake_lock_file</a>, <a href="#nixpkgs_flake_package-nix_flake_file_deps">nix_flake_file_deps</a>, <a href="#nixpkgs_flake_package-package">package</a>,
<a href="#nixpkgs_flake_package-build_file">build_file</a>, <a href="#nixpkgs_flake_package-build_file_content">build_file_content</a>, <a href="#nixpkgs_flake_package-nixopts">nixopts</a>, <a href="#nixpkgs_flake_package-quiet">quiet</a>, <a href="#nixpkgs_flake_package-fail_not_supported">fail_not_supported</a>, <a href="#nixpkgs_flake_package-kwargs">kwargs</a>)
</pre>

Make the content of a local Nix Flake package available in the Bazel workspace.

#### Parameters

<table class="params-table">
<colgroup>
<col class="col-param" />
<col class="col-description" />
</colgroup>
<tbody>
<tr id="nixpkgs_flake_package-name">
<td><code>name</code></td>
<td>

required.

<p>

A unique name for this repository.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-nix_flake_file">
<td><code>nix_flake_file</code></td>
<td>

required.

<p>

Label to `flake.nix` that will be evaluated.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-nix_flake_lock_file">
<td><code>nix_flake_lock_file</code></td>
<td>

required.

<p>

Label to `flake.lock` that corresponds to `nix_flake_file`.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-nix_flake_file_deps">
<td><code>nix_flake_file_deps</code></td>
<td>

optional.
default is <code>[]</code>

<p>

Additional dependencies of `nix_flake_file` if any.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-package">
<td><code>package</code></td>
<td>

optional.
default is <code>None</code>

<p>

Nix Flake package to make available. The default package will be used if not specified.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-build_file">
<td><code>build_file</code></td>
<td>

optional.
default is <code>None</code>

<p>

The file to use as the BUILD file for this repository. See [`nixpkgs_package`](#nixpkgs_package-build_file) for more information.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-build_file_content">
<td><code>build_file_content</code></td>
<td>

optional.
default is <code>""</code>

<p>

Like `build_file`, but a string of the contents instead of a file name. See [`nixpkgs_package`](#nixpkgs_package-build_file_content) for more information.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-nixopts">
<td><code>nixopts</code></td>
<td>

optional.
default is <code>[]</code>

<p>

Extra flags to pass when calling Nix. See [`nixpkgs_package`](#nixpkgs_package-nixopts) for more information.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-quiet">
<td><code>quiet</code></td>
<td>

optional.
default is <code>False</code>

<p>

Whether to hide the output of the Nix command.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-fail_not_supported">
<td><code>fail_not_supported</code></td>
<td>

optional.
default is <code>True</code>

<p>

If set to `True` (default) this rule will fail on platforms which do not support Nix (e.g. Windows). If set to `False` calling this rule will succeed but no output will be generated.

</p>
</td>
</tr>
<tr id="nixpkgs_flake_package-kwargs">
<td><code>kwargs</code></td>
<td>

optional.

</td>
</tr>
</tbody>
</table>


<a id="#nixpkgs_git_repository"></a>

### nixpkgs_git_repository
Expand Down Expand Up @@ -1750,7 +1919,7 @@ default is <code>None</code>

The file to use as the BUILD file for this repository.

Its contents are copied copied into the file `BUILD` in root of the nix output folder. The Label does not need to be named `BUILD`, but can be.
Its contents are copied into the file `BUILD` in root of the nix output folder. The Label does not need to be named `BUILD`, but can be.

For common use cases we provide filegroups that expose certain files as targets:

Expand Down
Loading