switch to GRUB with os-prober for multi-boot

This commit is contained in:
2026-05-30 16:09:53 +08:00
parent dcc8928aab
commit 574e356a5a
+7 -9
View File
@@ -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";
}