add dual use #55
19
README.md
19
README.md
|
@ -27,3 +27,22 @@ Afterwards, create a `default.nix` file containing the following:
|
||||||
```
|
```
|
||||||
|
|
||||||
If you would like a `shell.nix` file, create one containing the above, replacing `defaultNix` with `shellNix`.
|
If you would like a `shell.nix` file, create one containing the above, replacing `defaultNix` with `shellNix`.
|
||||||
|
|
||||||
|
|
||||||
|
## Call Parent Flake (second use)
|
||||||
|
|
||||||
|
To use, add the following to your subflake's flake.nix:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs.flake-compat.url = "github:edolstra/flake-compat";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Afterwards, you can use it to call a flake from anywhere, including a parent directory, as follows:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
parent = flake-compat ../.;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
@ -188,6 +188,8 @@ let
|
||||||
|
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
|
inherit result; # consumed by flake.nix
|
||||||
|
|
||||||
defaultNix =
|
defaultNix =
|
||||||
(builtins.removeAttrs result ["__functor"])
|
(builtins.removeAttrs result ["__functor"])
|
||||||
// (if result ? defaultPackage.${system} then { default = result.defaultPackage.${system}; } else {})
|
// (if result ? defaultPackage.${system} then { default = result.defaultPackage.${system}; } else {})
|
||||||
|
|
Loading…
Reference in a new issue