From 8baff4637e9c7e56a1c7cee65817afe8a46b6ee8 Mon Sep 17 00:00:00 2001 From: Qubasa Date: Mon, 10 Feb 2025 12:38:04 +0700 Subject: [PATCH] clan-cli: Fix disko template to not fail because of missing bootloader. --- pkgs/clan-cli/clan_cli/api/disk.py | 7 ++++++- templates/disk/single-disk/default.nix | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/clan_cli/api/disk.py b/pkgs/clan-cli/clan_cli/api/disk.py index ed68e87a1..8f3e73e4c 100644 --- a/pkgs/clan-cli/clan_cli/api/disk.py +++ b/pkgs/clan-cli/clan_cli/api/disk.py @@ -138,6 +138,7 @@ def set_machine_disk_schema( # Use get disk schemas to get the placeholders and their options placeholders: dict[str, str], force: bool = False, + allow_uknown_placeholders: bool = False, ) -> None: """ Set the disk placeholders of the template @@ -182,7 +183,11 @@ def set_machine_disk_schema( ) # Invalid value. Check if the value is one of the provided options - if ph.options and placeholder_value not in ph.options: + if ( + ph.options + and placeholder_value not in ph.options + and not allow_uknown_placeholders + ): msg = ( f"Invalid value {placeholder_value} for placeholder {placeholder_name}" ) diff --git a/templates/disk/single-disk/default.nix b/templates/disk/single-disk/default.nix index 4f1a5e532..85ebbd419 100644 --- a/templates/disk/single-disk/default.nix +++ b/templates/disk/single-disk/default.nix @@ -1,4 +1,8 @@ { + + boot.loader.grub.efiSupport = true; + boot.loader.grub.efiInstallAsRemovable = true; + boot.loader.grub.enable = true; disko.devices = { disk = { main = { @@ -8,6 +12,11 @@ content = { type = "gpt"; partitions = { + "boot" = { + size = "1M"; + type = "EF02"; # for grub MBR + priority = 1; + }; ESP = { type = "EF00"; size = "500M";