From 0693dbbc643d691062db6d13d999243a1a31d0b3 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Tue, 26 Nov 2024 21:20:10 +0800 Subject: [PATCH] =?UTF-8?q?nixos:=20=E4=BF=AE=E5=A4=8D=E8=B6=85=E8=BF=87?= =?UTF-8?q?=202g=20=E5=86=85=E5=AD=98=E6=97=B6=E6=97=A0=E6=B3=95=E5=AE=89?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trans.sh b/trans.sh index 00cb761..35fcb0f 100644 --- a/trans.sh +++ b/trans.sh @@ -1331,7 +1331,9 @@ install_nixos() { # 挂载分区,创建 swapfile mount_part_basic_layout /os /os/efi - create_swap $swap_size /os/swapfile + if [ "$swap_size" -gt 0 ]; then + create_swap "$swap_size" /os/swapfile + fi # 步骤 # 1. 安装 nix (nix-xxx)