From 08691d0515a44097fcaf27f59d002805afd0e105 Mon Sep 17 00:00:00 2001 From: Emily Ann Ediger Date: Mon, 18 Jun 2018 23:54:45 -0500 Subject: [PATCH 1/3] Grub: default is signed int. Fixes #42152 --- nixos/modules/system/boot/loader/grub/grub.nix | 2 +- nixos/modules/system/boot/loader/grub/install-grub.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 2e497ff9f2c..ee07d8657ef 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -386,7 +386,7 @@ in default = mkOption { default = 0; - type = types.int; + type = types.str; description = '' Index of the default menu item to be booted. ''; diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl index 872261d0edf..d1ff6e6bf52 100644 --- a/nixos/modules/system/boot/loader/grub/install-grub.pl +++ b/nixos/modules/system/boot/loader/grub/install-grub.pl @@ -54,7 +54,7 @@ my $splashImage = get("splashImage"); my $configurationLimit = int(get("configurationLimit")); my $copyKernels = get("copyKernels") eq "true"; my $timeout = int(get("timeout")); -my $defaultEntry = int(get("default")); +my $defaultEntry = get("default"); my $fsIdentifier = get("fsIdentifier"); my $grubEfi = get("grubEfi"); my $grubTargetEfi = get("grubTargetEfi"); From ae04fb01f8867c112fdbb7334de546875c31e117 Mon Sep 17 00:00:00 2001 From: Emily Ann Ediger Date: Tue, 19 Jun 2018 01:59:21 -0500 Subject: [PATCH 2/3] set default to type.str --- nixos/modules/system/boot/loader/grub/grub.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index ee07d8657ef..f1da2f41b5c 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -385,7 +385,7 @@ in }; default = mkOption { - default = 0; + default = "0"; type = types.str; description = '' Index of the default menu item to be booted. From ac0136509ce775b5d14bd2de0cf010f6c1bdc47e Mon Sep 17 00:00:00 2001 From: Emily Ann Ediger Date: Tue, 19 Jun 2018 04:05:50 -0500 Subject: [PATCH 3/3] added suggestion to support both str and int --- nixos/modules/system/boot/loader/grub/grub.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index f1da2f41b5c..42da6585722 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -386,7 +386,8 @@ in default = mkOption { default = "0"; - type = types.str; + type = types.either types.int types.str; + apply = toString; description = '' Index of the default menu item to be booted. '';