1
0
Fork 1
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:
Eelco Dolstra 2020-02-07 15:26:12 +01:00
parent c08930874a
commit 4089dbf090

View file

@ -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