support for inputs.self.submodules flake attribute #942

Closed
opened 2025-07-29 22:22:33 +00:00 by janw4ld · 4 comments

https://github.com/NixOS/nix/pull/12421 introduced an inputs.self.submodules flake attribute that makes a flake just work if its tree imports git submodules, it's introduced as part of a general inputs.self flake attrset that invalidates and refetches the flake if its values override the flake fetcher's default behaviour.
this change broke lix's compatibility with upstream flakes, since the self attrset has a different schema than other flake inputs resulting in lix throwing an exception while fetching a flake that uses it.
this attribute is also -afaik- the only solution that actually works for using a flake with submodules as an input to another flake, because the ?submodules=1 query param doesn't get parsed/considered consistently.

i already wrote and (manually) tested a port of Eelco's PR, and also gated inputs.self behind an experimental-feature. please LMK what you think of this change/addition.

<https://github.com/NixOS/nix/pull/12421> introduced an `inputs.self.submodules` flake attribute that makes a flake *just work* if its tree imports git submodules, it's introduced as part of a general `inputs.self` flake attrset that invalidates and refetches the flake if its values override the flake fetcher's default behaviour. this change broke lix's compatibility with upstream flakes, since the `self` attrset has a different schema than other flake inputs resulting in lix throwing an exception while fetching a flake that uses it. this attribute is also -afaik- the only solution that actually works for using a flake with submodules as an input to another flake, because the `?submodules=1` query param doesn't get parsed/considered consistently. i already wrote and (manually) tested a port of Eelco's PR, and also gated `inputs.self` behind an experimental-feature. please LMK what you think of this change/addition.
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/3839 ("libexpr/flake: add inputs.self.submodules flake attribute")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/3839", "number": 3839, "kind": "commit message"}], "cl_meta": {"3839": {"change_title": "libexpr/flake: add `inputs.self.submodules` flake attribute"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/3839](https://gerrit.lix.systems/c/lix/+/3839) ("libexpr/flake: add `inputs.self.submodules` flake attribute")
Author

i decided to put it behind an experimental-feature flag because im one of only 18 repos using it on github, and the change feels drastic for modifying the flakes schema, so off by default felt better

i decided to put it behind an experimental-feature flag because im one of only 18 repos using it on github, and the change feels _drastic_ for modifying the flakes schema, so off by default felt better
Owner

FYI it's also filed here: #929

FYI it's also filed here: https://git.lix.systems/lix-project/lix/issues/929
Author

it's ready for review now

it's ready for review now
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#942
No description provided.