Deprecate --install-grub in favor of --install-bootloader for nixos-rebuild.

Fixes #14293
This commit is contained in:
Shea Levy
2016-08-16 07:51:58 -04:00
parent 38f306f492
commit b4954a8f38
5 changed files with 21 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ import subprocess
import glob
import tempfile
import errno
import warnings
def copy_if_not_exists(source, dest):
if not os.path.exists(dest):
@@ -92,8 +93,11 @@ parser = argparse.ArgumentParser(description='Update NixOS-related systemd-boot
parser.add_argument('default_config', metavar='DEFAULT-CONFIG', help='The default NixOS config to boot')
args = parser.parse_args()
# We deserve our own env var!
if os.getenv("NIXOS_INSTALL_GRUB") == "1":
warnings.warn("NIXOS_INSTALL_GRUB env var deprecated, use NIXOS_INSTALL_BOOTLOADER", DeprecationWarning)
os.environ["NIXOS_INSTALL_BOOTLOADER"] = "1"
if os.getenv("NIXOS_INSTALL_BOOTLOADER") == "1":
if "@canTouchEfiVariables@" == "1":
subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "install"])
else: