nixos-option: Match the behavior described in detection order
Set no_flake if $NIXOS_CONFIG is set or nixos-config= in $NIX_PATH
This commit is contained in:
parent
71f3af90d2
commit
62e93c107f
@ -89,6 +89,10 @@ done
|
||||
# `--no-flake`
|
||||
# /etc/nixos/flake.nix (if exists)
|
||||
|
||||
if [[ -n "${NIXOS_CONFIG:-}" ]] || nix-instantiate --find-file nixos-config >/dev/null 2>&1; then
|
||||
no_flake=true
|
||||
fi
|
||||
|
||||
if [[ -z "$flake" ]] && [[ -e /etc/nixos/flake.nix ]] && [[ "$no_flake" == "false" ]]; then
|
||||
flake="$(dirname "$(realpath /etc/nixos/flake.nix)")"
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user