Git repository subdirectories should be different inputs
What happened?
When adding two different flakes as inputs in devbox.json based on private git input, devbox will interpret them as one input and therefore not install the dependencies correctly.
e.g. devbox.json:
"packages": [
"git+ssh://[email protected]/devbox-shims.git?dir=betteralign&ref=master&rev=17d2bedca4884176e0d08078aa42311053e531c2",
"git+ssh://[email protected]/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43",
]
devbox.lock:
{
"git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43": {
"last_modified": "1970-01-01T00:00:00Z",
"resolved": "git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43"
},
}
Only one of the inputs is considered, even though the dir parameter means they really are different individual inputs.
Steps to reproduce
Command
No response
devbox.json
Devbox version
0.16.0
Nix version
nix (Nix) 2.28.5
What system does this bug occur on?
macOS (Apple Silicon)
Debug logs
time=2025-09-23T22:33:25.565+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/maxiemgeldhof/development/recommendations-api/devbox.json dur=852.708µs
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/maxiemgeldhof/development/recommendations-api/devbox.json dur=70.75µs
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.566+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.567+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.567+02:00 level=DEBUG source=go.jetify.com/devbox/nix/nix.go:143 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' --version --debug"
time=2025-09-23T22:33:25.682+02:00 level=DEBUG source=go.jetify.com/devbox/nix/nix.go:143 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' --version --debug" cmd.path=/run/current-system/sw/bin/nix cmd.pid=72258 cmd.code=0 cmd.dur=115.150666ms
time=2025-09-23T22:33:25.682+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-09-23T22:33:25.682+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-09-23T22:33:25.682+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/maxiemgeldhof/development/recommendations-api/devbox.json dur=209.834µs
time=2025-09-23T22:33:25.683+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.683+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.683+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.683+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.683+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.683+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:25.689+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/flake.go:27 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' flake metadata --json github:NixOS/nixpkgs/nixpkgs-unstable"
^C
(devbox) ~/development/recommendations-api (master ✗) DEVBOX_DEBUG=1 devbox update
time=2025-09-23T22:33:40.655+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-09-23T22:33:40.655+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-09-23T22:33:40.656+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/maxiemgeldhof/development/recommendations-api/devbox.json dur=726.25µs
time=2025-09-23T22:33:40.656+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.656+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.656+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.658+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.658+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-09-23T22:33:40.658+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-09-23T22:33:40.658+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/maxiemgeldhof/development/recommendations-api/devbox.json dur=378.584µs
time=2025-09-23T22:33:40.659+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.659+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.659+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.659+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.659+02:00 level=DEBUG source=go.jetify.com/devbox/nix/nix.go:143 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' --version --debug"
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/nix/nix.go:143 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' --version --debug" cmd.path=/run/current-system/sw/bin/nix cmd.pid=73061 cmd.code=0 cmd.dur=121.716208ms
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/maxiemgeldhof/development/recommendations-api/devbox.json dur=133.541µs
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.781+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:33:40.789+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/flake.go:27 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' flake metadata --json github:NixOS/nixpkgs/nixpkgs-unstable"
time=2025-09-23T22:34:14.682+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/flake.go:27 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' flake metadata --json github:NixOS/nixpkgs/nixpkgs-unstable" cmd.path=/run/current-system/sw/bin/nix cmd.pid=73064 cmd.code=0 cmd.dur=33.893913292s
time=2025-09-23T22:34:14.686+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:14.686+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
Info: Already up-to-date git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43
time=2025-09-23T22:34:14.686+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:14.686+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:14.687+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:14.687+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:14.687+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:14.687+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:14.687+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:14.687+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
Info: Installing the following packages to the nix store: git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43
time=2025-09-23T22:34:14.694+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/build.go:50 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' build --impure --no-link --refresh 'git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43'"
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
time=2025-09-23T22:34:15.990+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/build.go:50 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' build --impure --no-link --refresh 'git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43'" cmd.path=/run/current-system/sw/bin/nix cmd.pid=74578 cmd.code=0 cmd.dur=1.296065042s
time=2025-09-23T22:34:15.990+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:15.990+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:15.990+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:15.990+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:15.991+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/search.go:105 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' search 'git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43' ^ --json"
time=2025-09-23T22:34:16.091+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/search.go:105 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' search 'git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43' ^ --json" cmd.path=/run/current-system/sw/bin/nix cmd.pid=74679 cmd.code=0 cmd.dur=100.439334ms
time=2025-09-23T22:34:16.092+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/nix.go:83 msg="running print-dev-env cmd" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/maxiemgeldhof/development/recommendations-api/.devbox/gen/flake"
⣾ Computing the Devbox environment...
time=2025-09-23T22:34:16.092+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/nix.go:84 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/maxiemgeldhof/development/recommendations-api/.devb
⣻ Computing the Devbox environment...
time=2025-09-23T22:34:18.034+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/nix.go:84 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/maxiemgeldhof/development/recommendations-api/.devbox
✓ Computed the Devbox environment.
time=2025-09-23T22:34:18.038+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/profiles.go:26 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' profile list --profile /Users/maxiemgeldhof/development/recommendations-api/.devbox/nix/profile/default --json"
time=2025-09-23T22:34:18.149+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/profiles.go:26 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' profile list --profile /Users/maxiemgeldhof/development/recommendations-api/.devbox/nix/profile/default --json" cmd.path=/run/current-system/sw/bin/nix cmd.pid=74970 cmd.code=0 cmd.dur=110.225791ms
time=2025-09-23T22:34:18.149+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:18.149+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:18.149+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:18.149+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
Info: Running "nix flake update"
time=2025-09-23T22:34:18.150+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/upgrade.go:29 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' flake update --flake /Users/maxiemgeldhof/development/recommendations-api/.devbox/gen/flake"
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/upgrade.go:29 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' flake update --flake /Users/maxiemgeldhof/development/recommendations-api/.devbox/gen/flake" cmd.path=/run/current-system/sw/bin/nix cmd.pid=74976 cmd.code=1 cmd.dur=145.234083ms
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/maxiemgeldhof/development/recommendations-api/devbox.json dur=96.125µs
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
time=2025-09-23T22:34:18.295+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg="" mode=auto
This may not be Devbox but instead a limitation of Nix itself: my understanding is that Nix flakes are designed for 1 flake per repo.
I think we could check by trying to have Nix build each ref and see if it works. If it does, then this might be a Devbox issue after all. Try running:
nix build "git+ssh://[email protected]/devbox-shims.git?dir=betteralign&ref=master&rev=17d2bedca4884176e0d08078aa42311053e531c2"
and
nix build "git+ssh://[email protected]/devbox-shims.git?dir=recovergoroutine&ref=master&rev=593d44945851d912f0c2158c46cc76da445adc43"
to see if Nix itself can handle the dir query param.
If Nix can't handle the dir query param then I think you'll need to refactor to a single top-level flake. Since flakes are ~ just an entrypoint into Nix code, you can still keep configurations in each subfolder and use the flake to expose them.
@drewgingerich
This may not be Devbox but instead a limitation of Nix itself: my understanding is that Nix flakes are designed for 1 flake per repo.
To my understanding, flakes own the directory they live in and all subdirectories under it. Not a repository.
I think we could check by trying to have Nix build each ref and see if it works. If it does, then this might be a Devbox issue after all. Try running:
Nix builds these without problem, in fact, even my original message builds just fine - the problem is that devbox has just removed one of the inputs. The input that is left, at random, builds just fine and is present in the PATH.
Referencing the same repository multiple times on different revisions (/ other modificators like dir) is a core feature of nix flakes. e.g. this flake builds just fine:
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
testflake.url = "git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?#betteralign";
testflake2.url = "git+ssh://[email protected]/ota-insight-repos/ota-insight-platform/ota-insight-api/devbox-shims.git?#recovergoroutine";
};
outputs = { self, nixpkgs, testflake, testflake2 }: {
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
packages.aarch64-darwin.default = self.packages.aarch64-darwin.hello;
};
}
If Nix can't handle the dir query param then I think you'll need to refactor to a single top-level flake. Since flakes are ~ just an entrypoint into Nix code, you can still keep configurations in each subfolder and use the flake to expose them.
We've since refactored to a single flake with two outputs. We still experienced issues with adding two different outputs of that flake to our path, but I cannot reproduce this now.
Still, the original issue is a relevant problem that should be addressed imo.
Oh cool, thanks for teaching me something! And that does sound like a Devbox issue then, ya.