mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-20 04:31:52 +00:00
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
|
||||
|
||||
# Find configuration.nix and open editor instead of building.
|
||||
# FIXME: handle flakes
|
||||
if [ "$action" = edit ]; then
|
||||
NIXOS_CONFIG=${NIXOS_CONFIG:-$(nix-instantiate --find-file nixos-config)}
|
||||
exec "${EDITOR:-nano}" "$NIXOS_CONFIG"
|
||||
if [[ -z $flake ]]; then
|
||||
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
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue