When a repo is used as a path flake input inside another repo’s devenv, devenv expects
<input>/.devenv.flake.nix to exist. If that file is untracked, it is not included in the
flake snapshot, so devenv shell fails with:
error: '/nix/store/<...>/effect-utils/.devenv.flake.nix' does not exist
This happens even if the input is a valid flake and the .devenv.flake.nix is generated
locally (but not committed).
Repo layout:
repo-a/
devenv.yaml
devenv.nix
flake.nix
shared-lib/
flake.nix
# note: .devenv.flake.nix is missing (untracked)
Setup:
repo-a/(flake) usesdevenvand has input:shared-lib.url = "path:../shared-lib"
shared-lib/is a flake input. It does not commit.devenv.flake.nix.- Run:
devenv shellinrepo-a. - Failure:
.../.devenv.flake.nix does not exist.
- Must stay pure (no
--impure). - Must work for path inputs (local workspace checkouts).
- Should avoid per-repo hacks / heavy boilerplate.
Pros: works with path inputs, no extra logic. Cons: adds a file to every repo; feels like a workaround.
Minimal file:
{
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };
outputs = { self, nixpkgs, ... }: { };
}
(e.g. rsync-based workspace sync) Pros: keeps source repo clean. Cons: still breaks if someone uses a path input directly to the repo, not the copy.
Pros: no .devenv.flake.nix required.
Cons: might require builtins.path to avoid purity errors and bypasses flake outputs.
Ideal if supported, but unclear if there is a supported switch.
What is the recommended, idiomatic way to make devenv robust when it consumes
path-based flake inputs that may not include .devenv.flake.nix?
We’re leaning toward option 1 if it’s the standard expectation, but want guidance.