Creating a NixOS live CD/zh: Difference between revisions
Created page with "以下是<code>nix-build</code>使用的一些压缩方式的用时测试结果:" |
Created page with "压缩使得构建过程变得缓慢。" |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 94: | Line 94: | ||
===SSH=== | ===SSH=== | ||
在你的 <tt>iso.nix</tt> 中: | 在你的 <tt>iso.nix</tt> 中添加: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
| Line 132: | Line 132: | ||
=== 更快速的构建 === | === 更快速的构建 === | ||
构建过程缓慢的原因是压缩。 | |||
以下是<code>nix-build</code>使用的一些压缩方式的用时测试结果: | 以下是<code>nix-build</code>使用的一些压缩方式的用时测试结果: | ||
{| class="wikitable" style="margin:auto" | {| class="wikitable" style="margin:auto" | ||
|+ | |+ 压缩测试结果 | ||
|- | |- | ||
! squashfsCompression !! | ! squashfsCompression !! 用时 !! 大小 | ||
|- | |- | ||
| <code>lz4</code> || 100s || 59% | | <code>lz4</code> || 100s || 59% | ||
| Line 150: | Line 149: | ||
| <code>xz -Xdict-size 100%</code> (default) || 450s || 43% | | <code>xz -Xdict-size 100%</code> (default) || 450s || 43% | ||
|} | |} | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
| Line 156: | Line 154: | ||
</div> | </div> | ||
如果你并不在意文件大小,可以在你的<code>iso.nix</code>中添加如下内容以使用更快的压缩方式: | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
| Line 170: | Line 165: | ||
== 另见 == | == 另见 == | ||
* [https://nixos.org/manual/nixos/stable/index.html#sec-building-image NixOS 手册: 构建一个 NixOS (Live) ISO]. | |||
* [https://nixos.org/manual/nixos/stable/index.html#sec-building-image NixOS | |||
[[Category:NixOS]] | [[Category:NixOS]] | ||
[[Category:Deployment]] | [[Category:Deployment]] | ||
[[Category:Cookbook]] | [[Category:Cookbook]] | ||