Skip to content

Commit 98f5469

Browse files
committed
Add extra documentation of evalFlake
1 parent 9348b6a commit 98f5469

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ This package repository is licensed under the [MIT License](LICENSE).
1010
The following important clarification made in the [`nixpkgs`](https://github.com/NixOS/nixpkgs/blob/master/README.md#license) repository applies to this repository as well:
1111
> MIT license does not apply to the packages built by Nixpkgs, merely to the files in this repository (the Nix expressions, build scripts, NixOS modules, etc.).
1212
> It also might not apply to patches included in Nixpkgs, which may be derivative works of the packages to which they apply.The aforementioned artifacts are all covered by the licenses of the respective packages.
13+
14+
## Contributing
15+
16+
The inputs to this flake is divided into public parts in `flake.nix` and private inputs in `private/flake.nix`.
17+
To update all inputs, make sure that `nix flake update` is performed in `private/flake.nix` as well.

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
inputs = {
88
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
99
flake-utils.url = "github:numtide/flake-utils";
10+
11+
# We also have some additional dependencies in private/flake.nix.
12+
# They're not exposed to the user to save downstream user from having a
13+
# bloating flake.lock and having to override them.
1014
};
1115

1216
nixConfig = {

lib/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,20 @@ Notice, that `pkgs.mdbook` doesn't need to be given as part of the `nativeBuildI
2929
In this case, just python.
3030

3131
`standardMdbookFileset` and `hasExts` are also provided to further help in creating derivations.
32+
33+
## `evalFlake` function
34+
35+
The `lowrisc-nix` provides a `evalFlake` function which is a more powerful version than the nix's `builtins.getFlake` function:
36+
* It allows a store path to be used (this includes flake sources which are copied to the store), which `builtins.getFlake` does not.
37+
* It allows dependency to be overriden, similar to `inputs.<name>.follows`.
38+
39+
The signature is `{ src: path, inputOverride: attrsOf flake } -> flake`. An example of it use:
40+
```nix
41+
lib.evalFlake {
42+
src = /path/to/flake;
43+
inputOverride = {
44+
nixpkgs = inputs.nixpkgs;
45+
};
46+
}
47+
```
48+

0 commit comments

Comments
 (0)