Sync from github/edolstra: add outputs and be careful about flake inputs node name #80

Merged
jade merged 14 commits from bryango/flake-compat:main into main 2025-05-28 19:23:32 +00:00
Contributor

This makes the following two PRs available here:

The diff is pretty small, but the commit history is huge because I chose to use git merge edolstra/master, therefore upstream commit hashes are all preserved. This makes it easier to track upstream changes. For example, one can then easily do:

  • git log edolstra/master.. for all changes made here in the lix fork, and
  • git log ..edolstra/master for unmerged changes from upstream.
This makes the following two PRs available here: - https://github.com/edolstra/flake-compat/pull/61 - correct behavior for the `flake-compat` node name look-up - https://github.com/edolstra/flake-compat/pull/69 - add the `outputs` attribute; see also: #78 The diff is pretty small, but the commit history is huge because I chose to use `git merge edolstra/master`, therefore upstream commit hashes are all preserved. This makes it easier to track upstream changes. For example, one can then easily do: - `git log edolstra/master..` for all changes made here in the lix fork, and - `git log ..edolstra/master` for unmerged changes from upstream.
Check for pure eval mode before calling `builtins.storePath`
README: fix node name look-up
Fixes #43.
Expose revCount attribute for git inputs
Use builtins.fetchTree if available
They were already exposed in `defaultNix` and `shellNix`, but
"polluted" by a `default` attribute and probably not very intuitive to
find.

Issue #15.
Return all outputs
This is a rare combination, and it would have been more relevant
before https://github.com/edolstra/flake-compat/pull/67, but it is a
tested fix nonetheless.
(Specifically, for issues like https://github.com/hercules-ci/flake-parts/issues/252)

builtins.path had `sha256` since its introduction, so no problem
there.

This also catches accidental path-based impurities. Flakes are meant
to be pure. "path" inputs do ask for trouble, but that doesn't mean
we should violate purity.
Also note that `fetchTree` will happily use the `narHash` anyway, so
this change makes the behavior more consistent between configurations
with and without `fetchTree`.
Fix non-fetchTree pure-eval use of builtins.path
As per 96e550efc5
Format with nixfmt
jade approved these changes 2025-05-28 19:23:19 +00:00
jade left a comment
Owner

seems reasonable to me

seems reasonable to me
jade merged commit 88e58d66ef into main 2025-05-28 19:23:32 +00:00
Sign in to join this conversation.
No description provided.