nixos-rebuild: Make 'edit' work with with flakes
This commit is contained in:
parent
c08930874a
commit
4089dbf090
@ -285,10 +285,13 @@ if [[ -n $flake ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Find configuration.nix and open editor instead of building.
|
# Find configuration.nix and open editor instead of building.
|
||||||
# FIXME: handle flakes
|
|
||||||
if [ "$action" = edit ]; then
|
if [ "$action" = edit ]; then
|
||||||
NIXOS_CONFIG=${NIXOS_CONFIG:-$(nix-instantiate --find-file nixos-config)}
|
if [[ -z $flake ]]; then
|
||||||
exec "${EDITOR:-nano}" "$NIXOS_CONFIG"
|
NIXOS_CONFIG=${NIXOS_CONFIG:-$(nix-instantiate --find-file nixos-config)}
|
||||||
|
exec "${EDITOR:-nano}" "$NIXOS_CONFIG"
|
||||||
|
else
|
||||||
|
exec nix edit "${lockFlags[@]}" -- "$flake#$flakeAttr"
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user