# How to include submodules in \`nix flake lock --update-input\`

**URL:** https://discourse.nixos.org/t/how-to-include-submodules-in-nix-flake-lock-update-input/50195
**Category:** Help
**Created:** [August 6, 2024, 8:01am UTC](https://discourse.nixos.org/t/how-to-include-submodules-in-nix-flake-lock-update-input/50195 "2024-08-06T08:01:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ethanniser](https://discourse.nixos.org/user_avatar/discourse.nixos.org/ethanniser/32/27640_2.png) [@ethanniser](https://discourse.nixos.org/u/ethanniser)
#### Post date: [August 6, 2024, 8:01am UTC](https://discourse.nixos.org/t/how-to-include-submodules-in-nix-flake-lock-update-input/50195/1 "2024-08-06T08:01:14Z")

</div>

I have a parent flake who has an input of a child flake in a git submodule.

This setup seems to have some issues when referring to the child flake via `child.url = "path:./child";` [(related issue)](https://github.com/NixOS/nix/issues/3978)

The solutions I saw were:

1. use a github url to the submodule
2. use a absolute file path
3. use relative path but force update the lockfile before running the flake  
(option 1 also requires this force update if you want the latest changes)

although it is kind of annoying, I am fine with having to force update the lock file, the problem is this command doesn’t seem to bring in submodules:

```auto
nix flake lock --update-input nvim            
warning: Git tree '/Users/ethan/.config/nix-darwin' is dirty
error (ignored): error: end of string reached
error:
       … while updating the lock file of flake 'git+file:///Users/ethan/.config/nix-darwin'

       … while updating the flake input 'nvim'

       … while fetching the input 'path:./nvim'

       error: getting status of '/nix/store/a5zkqrqpjqgf357sg232ly301a6hz1z2-source/nvim': No such file or directory

```

normally when I run the flake I use `‘.?submodules=1’ but there doesn’t seem to be a way to do that here

any help is appreciated thanks

---

<div class="post-metadata">

### Author: ![ethanniser](https://discourse.nixos.org/user_avatar/discourse.nixos.org/ethanniser/32/27640_2.png) [@ethanniser](https://discourse.nixos.org/u/ethanniser)
#### Post date: [August 6, 2024, 8:17am UTC](https://discourse.nixos.org/t/how-to-include-submodules-in-nix-flake-lock-update-input/50195/2 "2024-08-06T08:17:40Z")

</div>

I’m just using [GitHub - ursi/get-flake: builtins.getFlake without the restrictions](https://github.com/ursi/get-flake) for now  
but this feels pretty hacky to me?

would be curious if there is another way
