File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
pkgs/by-name/ni/nixos-option Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,9 @@ if [[ -n "$flake" ]]; then
7474 fi
7575 # Unlike nix cli, builtins.getFlake infer path:// when a path is given
7676 # See https://github.com/NixOS/nix/issues/5836
77- if [[ -d " $flake " ]] && [[ -e " $flake /.git" ]] ; then
77+ # Using `git rev-parse --show-toplevel` since we can't assume the flake dir
78+ # itself is a git repo, because the flake could be in a sub directory
79+ if [[ -d " $flake " ]] && git -C " $flake " rev-parse --show-toplevel & > /dev/null; then
7880 flake=" git+file://$( realpath " $flake " ) "
7981 fi
8082 if [[ -z " ${flakeAttr:- } " ]]; then
Original file line number Diff line number Diff line change 11{
22 lib ,
33 coreutils ,
4+ git ,
45 installShellFiles ,
56 jq ,
67 makeWrapper ,
@@ -56,6 +57,7 @@ stdenvNoCC.mkDerivation {
5657 --prefix PATH : ${
5758 lib . makeBinPath [
5859 coreutils
60+ git
5961 jq
6062 man-db
6163 nix
You can’t perform that action at this time.
0 commit comments