My homelab infrastructure monorepo has the "nodes" nix.flake under the nodes/ subdirectory. When I try to run the agenix wrapper in this subdirectory, it dies and gives the error "error: Could not determine location of your project's flake.nix. Please run this at or below your main directory containing the flake.nix." This is happening even though my pwd is the nodes/ directory with the nix.flake in it.
My homelab infrastructure monorepo has the "nodes" nix.flake under the nodes/ subdirectory. When I try to run the agenix wrapper in this subdirectory, it dies and gives the error "error: Could not determine location of your project's flake.nix. Please run this at or below your main directory containing the flake.nix." This is happening even though my pwd is the nodes/ directory with the nix.flake in it.
The bug seems to be here:
https://github.com/oddlama/agenix-rekey/blob/e02a57e08224422934974f19853d4d70ed7eaaaa/nix/package.nix#L21
USER_FLAKE_DIR
is being set to the output ofgit rev-parse --show-toplevel
, which is the parent git repository, not the subdirectory with my flake.The agenix wrapper should either: