Skip to content

Commit

Permalink
Merge pull request #69 from edolstra/add-outputs-attr
Browse files Browse the repository at this point in the history
Return all outputs
  • Loading branch information
edolstra authored Nov 27, 2024
2 parents e3408d6 + a1b45cd commit 9ed2ac1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

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
```
2 changes: 2 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ let

in
rec {
outputs = result;

defaultNix =
(builtins.removeAttrs result ["__functor"])
// (if result ? defaultPackage.${system} then { default = result.defaultPackage.${system}; } else {})
Expand Down

0 comments on commit 9ed2ac1

Please sign in to comment.