git.iko.soy/typeable/nixpkgs
on master help sign in
Remove boot.loader.grub.timeout and boot.loader.gummiboot.timeout

There is a generic boot.loader.timeout option.

commit32bed83b1804de5e905a2459603dde2b958bb847 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateWed 25 May 2016, 10:34 (11 years ago) parentfe875b4
9 files changed+12−31
nixos/modules/installer/cd-dvd/iso-image.nix+1−1 nixos/modules/rename.nix+2 nixos/modules/system/boot/loader/grub/grub.nix+2−9 nixos/modules/system/boot/loader/gummiboot/gummiboot.nix+1−15 nixos/modules/virtualisation/amazon-image.nix+1−1 nixos/modules/virtualisation/azure-common.nix+2−2 nixos/modules/virtualisation/brightbox-image.nix+1−1 nixos/modules/virtualisation/google-compute-image.nix+1−1 nixos/modules/virtualisation/nova-image.nix+1−1
nixos/modules/installer/cd-dvd/iso-image.nix+1−1
@@ -79,7 +79,7 @@ let
7979 echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} nomodeset" >> $out/loader/entries/nixos-livecd-nomodeset.conf
8080
8181 echo "default nixos-livecd" > $out/loader/loader.conf
82− echo "timeout ${builtins.toString config.boot.loader.gummiboot.timeout}" >> $out/loader/loader.conf
82+ echo "timeout ${builtins.toString config.boot.loader.timeout}" >> $out/loader/loader.conf
8383 '';
8484
8585 efiImg = pkgs.runCommand "efi-image_eltorito" { buildInputs = [ pkgs.mtools pkgs.libfaketime ]; }
nixos/modules/rename.nix+2
@@ -34,6 +34,8 @@ with lib;
3434 # Old Grub-related options.
3535 (mkRenamedOptionModule [ "boot" "initrd" "extraKernelModules" ] [ "boot" "initrd" "kernelModules" ])
3636 (mkRenamedOptionModule [ "boot" "extraKernelParams" ] [ "boot" "kernelParams" ])
37+ (mkRenamedOptionModule [ "boot" "loader" "grub" "timeout" ] [ "boot" "loader" "timeout" ])
38+ (mkRenamedOptionModule [ "boot" "loader" "gummiboot" "timeout" ] [ "boot" "loader" "timeout" ])
3739
3840 # smartd
3941 (mkRenamedOptionModule [ "services" "smartd" "deviceOpts" ] [ "services" "smartd" "defaults" "monitored" ])
nixos/modules/system/boot/loader/grub/grub.nix+2−9
@@ -48,12 +48,13 @@ let
4848 bootPath = args.path;
4949 storePath = config.boot.loader.grub.storePath;
5050 bootloaderId = if args.efiBootloaderId == null then "NixOS${efiSysMountPoint'}" else args.efiBootloaderId;
51+ timeout = if config.boot.loader.timeout == null then -1 else config.boot.loader.timeout;
5152 inherit efiSysMountPoint;
5253 inherit (args) devices;
5354 inherit (efi) canTouchEfiVariables;
5455 inherit (cfg)
5556 version extraConfig extraPerEntryConfig extraEntries
56− extraEntriesBeforeNixOS extraPrepareConfig configurationLimit copyKernels timeout
57+ extraEntriesBeforeNixOS extraPrepareConfig configurationLimit copyKernels
5758 default fsIdentifier efiSupport gfxmodeEfi gfxmodeBios;
5859 path = (makeBinPath ([
5960 pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.findutils pkgs.diffutils pkgs.btrfs-progs
@@ -313,14 +314,6 @@ in
313314 '';
314315 };
315316
316− timeout = mkOption {
317− default = if (config.boot.loader.timeout != null) then config.boot.loader.timeout else -1;
318− type = types.int;
319− description = ''
320− Timeout (in seconds) until GRUB boots the default menu item.
321− '';
322− };
323−
324317 default = mkOption {
325318 default = 0;
326319 type = types.int;
nixos/modules/system/boot/loader/gummiboot/gummiboot.nix+1−15
@@ -16,7 +16,7 @@ let
1616
1717 nix = config.nix.package.out;
1818
19− timeout = if cfg.timeout != null then cfg.timeout else "";
19+ timeout = if config.boot.loader.timeout != null then config.boot.loader.timeout else "";
2020
2121 inherit (efi) efiSysMountPoint canTouchEfiVariables;
2222 };
@@ -29,20 +29,6 @@ in {
2929
3030 description = "Whether to enable the gummiboot UEFI boot manager";
3131 };
32−
33− timeout = mkOption {
34− default = if config.boot.loader.timeout == null then 10000 else config.boot.loader.timeout;
35−
36− example = 4;
37−
38− type = types.nullOr types.int;
39−
40− description = ''
41− Timeout (in seconds) for how long to show the menu (null if none).
42− Note that even with no timeout the menu can be forced if the space
43− key is pressed during bootup
44− '';
45− };
4632 };
4733
4834 config = mkIf cfg.enable {
nixos/modules/virtualisation/amazon-image.nix+1−1
@@ -32,8 +32,8 @@ let cfg = config.ec2; in
3232 # Generate a GRUB menu. Amazon's pv-grub uses this to boot our kernel/initrd.
3333 boot.loader.grub.version = if cfg.hvm then 2 else 1;
3434 boot.loader.grub.device = if cfg.hvm then "/dev/xvda" else "nodev";
35− boot.loader.grub.timeout = 0;
3635 boot.loader.grub.extraPerEntryConfig = mkIf (!cfg.hvm) "root (hd0)";
36+ boot.loader.timeout = 0;
3737
3838 boot.initrd.postDeviceCommands =
3939 ''
nixos/modules/virtualisation/azure-common.nix+2−2
@@ -10,10 +10,10 @@ with lib;
1010 boot.kernelParams = [ "console=ttyS0" "earlyprintk=ttyS0" "rootdelay=300" "panic=1" "boot.panic_on_fail" ];
1111 boot.initrd.kernelModules = [ "hv_vmbus" "hv_netvsc" "hv_utils" "hv_storvsc" ];
1212
13− # Generate a GRUB menu.
13+ # Generate a GRUB menu.
1414 boot.loader.grub.device = "/dev/sda";
1515 boot.loader.grub.version = 2;
16− boot.loader.grub.timeout = 0;
16+ boot.loader.timeout = 0;
1717
1818 # Don't put old configurations in the GRUB menu. The user has no
1919 # way to select them anyway.
nixos/modules/virtualisation/brightbox-image.nix+1−1
@@ -94,7 +94,7 @@ in
9494
9595 # Generate a GRUB menu. Amazon's pv-grub uses this to boot our kernel/initrd.
9696 boot.loader.grub.device = "/dev/vda";
97− boot.loader.grub.timeout = 0;
97+ boot.loader.timeout = 0;
9898
9999 # Don't put old configurations in the GRUB menu. The user has no
100100 # way to select them anyway.
nixos/modules/virtualisation/google-compute-image.nix+1−1
@@ -102,7 +102,7 @@ in
102102
103103 # Generate a GRUB menu. Amazon's pv-grub uses this to boot our kernel/initrd.
104104 boot.loader.grub.device = "/dev/sda";
105− boot.loader.grub.timeout = 0;
105+ boot.loader.timeout = 0;
106106
107107 # Don't put old configurations in the GRUB menu. The user has no
108108 # way to select them anyway.
nixos/modules/virtualisation/nova-image.nix+1−1
@@ -27,7 +27,7 @@ with lib;
2727
2828 boot.kernelParams = [ "console=ttyS0" ];
2929 boot.loader.grub.device = "/dev/vda";
30− boot.loader.grub.timeout = 0;
30+ boot.loader.timeout = 0;
3131
3232 # Allow root logins
3333 services.openssh.enable = true;