1
0
Fork 0
mirror of https://github.com/edolstra/flake-compat.git synced 2024-12-14 11:47:34 +00:00

Return all outputs

They were already exposed in `defaultNix` and `shellNix`, but
"polluted" by a `default` attribute and probably not very intuitive to
find.

Issue #15.
This commit is contained in:
Eelco Dolstra 2024-11-27 16:44:58 +01:00
parent e3408d6ab2
commit a1b45cd4a2
2 changed files with 8 additions and 0 deletions

View file

@ -27,3 +27,9 @@ 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`.
You can access any flake output via the `outputs` attribute returned by `flake-compat`, e.g.
```nix
(import ... { src = ./.; }).outputs.packages.x86_64-linux.default
```

View file

@ -229,6 +229,8 @@ let
in in
rec { rec {
outputs = result;
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 {})