From 574e356a5a2ea42bcb743feec26b00385171c7be Mon Sep 17 00:00:00 2001 From: Aloys23 Date: Sat, 30 May 2026 16:09:53 +0800 Subject: [PATCH] switch to GRUB with os-prober for multi-boot --- configuration.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/configuration.nix b/configuration.nix index a5d4944..f889586 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,9 +17,14 @@ nixpkgs.config.allowUnfree = true; # ── 引导 ──────────────────────────────────────────────────── - boot.loader.systemd-boot.enable = true; - boot.loader.systemd-boot.configurationLimit = 10; # 只保留最近 10 次迭代 boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub = { + enable = true; + efiSupport = true; + device = "nodev"; + configurationLimit = 10; + useOSProber = true; # 检测其他系统(Windows 等) + }; # ── 网络 ──────────────────────────────────────────────────── networking.hostName = "nixos"; @@ -139,13 +144,6 @@ ffmpeg ]; - # ── 自动清理旧的系统迭代 ──────────────────────────────────── - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - # ── 系统状态版本(请勿修改) ──────────────────────────────── system.stateVersion = "25.11"; }