Using a flake that has inputs.self.submodules as an input doesn't work #970

Open
opened 2025-08-20 05:17:25 +00:00 by gepbird · 4 comments

Describe the bug

Consider a flake called child that sets inputs.self.submodules = true. Trying to use this flake as an input for another flake results in this error:

error: unsupported path input attribute 'submodules'

Steps To Reproduce

  1. Make sure you have 15a42d21a
  2. Enable experimental setting flake-self-attrs
  3. Run nix flake metadata "https://git.lix.systems/gepbird/submodules-imported-flake/archive/main.tar.gz"
  4. See error

Expected behavior

Just like running nix flake metadata in the child flake, it should return the usual Resolved URL, Locked URL and other metadata.

nix --version output

Note: I added 15a42d21a as a patch to the 2.93.3 lix package, it's not shown in the output below.

nix (Lix, like Nix) 2.93.3
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/gep/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/gep/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/gep/.local/state/nix/profile/etc/xdg/nix/nix.co
nf:/etc/profiles/per-user/gep/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/8p36nya9lp9psz3s3ahi392bfldmvsn0-lix-2.93.3/share

Additional context

My use case is having a public dotfiles flake (child) that sets self.inputs.submodules = true, because it has a git submodule that points to a private dotfiles-work flake. Trying to use this dotfiles flake as an input to one of my server flakes (parent) will fail with the above error.

As a workaround I'm not specifying submodules in the flake, but build my system with a rather long and ugly command: nom build ".?submodules=1#nixosConfigurations.$(hostname).config.system.build.toplevel" && sudo result/bin/switch-to-configuration switch.

## Describe the bug Consider a flake called child that sets `inputs.self.submodules = true`. Trying to use this flake as an input for another flake results in this error: ```console error: unsupported path input attribute 'submodules' ``` ## Steps To Reproduce 1. Make sure you have 15a42d21a 1. Enable experimental setting `flake-self-attrs` 1. Run `nix flake metadata "https://git.lix.systems/gepbird/submodules-imported-flake/archive/main.tar.gz"` 1. See error ## Expected behavior Just like running `nix flake metadata` in the child flake, it should return the usual Resolved URL, Locked URL and other metadata. ## `nix --version` output Note: I added 15a42d21a as a patch to the 2.93.3 lix package, it's not shown in the output below. ```console nix (Lix, like Nix) 2.93.3 System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/gep/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/gep/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/gep/.local/state/nix/profile/etc/xdg/nix/nix.co nf:/etc/profiles/per-user/gep/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/8p36nya9lp9psz3s3ahi392bfldmvsn0-lix-2.93.3/share ``` ## Additional context My use case is having a public dotfiles flake (child) that sets `self.inputs.submodules = true`, because it has a git submodule that points to a private dotfiles-work flake. Trying to use this dotfiles flake as an input to one of my server flakes (parent) will fail with the above error. As a workaround I'm not specifying submodules in the flake, but build my system with a rather long and ugly command: `nom build ".?submodules=1#nixosConfigurations.$(hostname).config.system.build.toplevel" && sudo result/bin/switch-to-configuration switch`.
Owner
cc @janw4ld @jade
Owner

you're using a version before this feature was implemented. try lix HEAD. here: https://wiki.lix.systems/books/lix-contributors/page/running-lix-main, or if you just want to test it temporarily, nix build .# in the lix repo.

however, I'm leaving this open to give you time so you can make sure our implementation actually works on your code.

you're using a version before this feature was implemented. try lix HEAD. here: https://wiki.lix.systems/books/lix-contributors/page/running-lix-main, or if you just want to test it temporarily, `nix build .#` in the lix repo. however, I'm leaving this open to give you time so you can make sure our implementation actually works on your code.
Owner

@jade I think you missed

Note: I added 15a42d21a as a patch to the 2.93.3 lix package, it's not shown in the output below.

:)

@jade I think you missed > Note: I added 15a42d21a as a patch to the 2.93.3 lix package, it's not shown in the output below. :)
Author

Just to be sure, I also tried it on main, and I got a slightly different error message:

lix ❯ result/bin/nix --version                                                                                     
nix (Lix, like Nix) 2.94.0-devpre20250820_c82af24
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/gep/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/gep/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/gep/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/gep/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/pzhkb9xym1s3x6q5kb3d1hin45kasgvz-lix-2.94.0-devpre20250820_c82af24/share
lix ❯ result/bin/nix flake metadata "https://git.lix.systems/gepbird/submodules-imported-flake/archive/main.tar.gz"
error:
       … while updating the lock file of flake 'https://git.lix.systems/api/v1/repos/gepbird/submodules-imported-flake/archive/4043a620f1ff3a5eebab61e9ee9d9b60ebf211af.tar.gz?narHash=sha256-R28CJN/Plf9pHXVmhElOOqSNU5olLI%2BRO%2Bj7mhuZOfU%3D&rev=4043a620f1ff3a5eebab61e9ee9d9b60ebf211af'

       error: unsupported input attribute 'submodules' for the 'path' scheme
Just to be sure, I also tried it on main, and I got a slightly different error message: ```console lix ❯ result/bin/nix --version nix (Lix, like Nix) 2.94.0-devpre20250820_c82af24 System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/gep/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/gep/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/gep/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/gep/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/pzhkb9xym1s3x6q5kb3d1hin45kasgvz-lix-2.94.0-devpre20250820_c82af24/share lix ❯ result/bin/nix flake metadata "https://git.lix.systems/gepbird/submodules-imported-flake/archive/main.tar.gz" error: … while updating the lock file of flake 'https://git.lix.systems/api/v1/repos/gepbird/submodules-imported-flake/archive/4043a620f1ff3a5eebab61e9ee9d9b60ebf211af.tar.gz?narHash=sha256-R28CJN/Plf9pHXVmhElOOqSNU5olLI%2BRO%2Bj7mhuZOfU%3D&rev=4043a620f1ff3a5eebab61e9ee9d9b60ebf211af' error: unsupported input attribute 'submodules' for the 'path' scheme ```
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#970
No description provided.