From e08bcdbec3265f701c175ae5ac9d813e10cad292 Mon Sep 17 00:00:00 2001
From: V <v@anomalous.eu>
Date: Sat, 29 Aug 2020 09:54:14 +0200
Subject: [PATCH] nixos-rebuild: don't quote $EDITOR

$EDITOR is allowed to contain flags, so it is important to allow the
shell to split this normally. For example, Sublime Text needs to be
passed --wait, since otherwise it will daemonise.
---
 nixos/modules/installer/tools/nixos-rebuild.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh
index e79cc5e24fb5..ed9c2509b6b6 100644
--- a/nixos/modules/installer/tools/nixos-rebuild.sh
+++ b/nixos/modules/installer/tools/nixos-rebuild.sh
@@ -291,7 +291,7 @@ if [ "$action" = edit ]; then
         if [[ -d $NIXOS_CONFIG ]]; then
             NIXOS_CONFIG=$NIXOS_CONFIG/default.nix
         fi
-        exec "${EDITOR:-nano}" "$NIXOS_CONFIG"
+        exec ${EDITOR:-nano} "$NIXOS_CONFIG"
     else
         exec nix edit "${lockFlags[@]}" -- "$flake#$flakeAttr"
     fi