Creating a NixOS live CD: Difference between revisions

Unabomberlive (talk | contribs)
Marked this version for translation
Tags: Mobile edit Mobile web edit
Unabomberlive (talk | contribs)
mNo edit summary
Tags: Mobile edit Mobile web edit
Line 1: Line 1:
<translate>
<translate>
<!--T:1-->
== Motivation ==
== Motivation ==
</translate>
<translate>
Creating a modified NixOS LiveCD out of an existing working NixOS installation has a number of benefits:
Creating a modified NixOS LiveCD out of an existing working NixOS installation has a number of benefits:
* Ensures authenticity.
* Ensures authenticity.
Line 8: Line 9:
</translate>
</translate>
<translate>
<translate>
<!--T:2-->
== Building ==
== Building ==
</translate>
<translate>
Building minimal NixOS installation CD with the <code>nix-build</code> command by creating this <code>iso.nix</code>-file. In this example with [[Neovim]] preinstalled.  
Building minimal NixOS installation CD with the <code>nix-build</code> command by creating this <code>iso.nix</code>-file. In this example with [[Neovim]] preinstalled.  
</translate>
</translate>
Line 74: Line 76:
<translate>
<translate>
=== Testing the image === <!--T:7-->
=== Testing the image === <!--T:7-->
 
</translate>
<!--T:8-->
<translate>
To inspect the contents of the ISO image:
To inspect the contents of the ISO image:
</translate>
</translate>
Line 96: Line 98:
<!--T:10-->
<!--T:10-->
===SSH===
===SSH===
</translate>
<translate>
In your <tt>iso.nix</tt>:
In your <tt>iso.nix</tt>:
</translate>
</translate>
Line 111: Line 115:
<translate>
<translate>
===Static IP Address=== <!--T:11-->
===Static IP Address=== <!--T:11-->
 
</translate>
<!--T:12-->
<translate>
Static IP addresses can be set in the image itself. This can be useful for VPS installation.
Static IP addresses can be set in the image itself. This can be useful for VPS installation.
</translate>
</translate>
Line 133: Line 137:
<!--T:13-->
<!--T:13-->
=== Building faster ===
=== Building faster ===
</translate>
<translate>
The build process is slow because of compression.
The build process is slow because of compression.


<!--T:14-->
Here are some timings for <code>nix-build</code>:
Here are some timings for <code>nix-build</code>:
</translate>
</translate>
<translate>
{| class="wikitable" style="margin:auto"
{| class="wikitable" style="margin:auto"
|+ Compression results
|+ Compression results
Line 151: Line 157:
| <code>xz -Xdict-size 100%</code> (default) || 450s || 43%
| <code>xz -Xdict-size 100%</code> (default) || 450s || 43%
|}
|}
</translate>
<translate>
<translate>
<!--T:15-->
See also: [https://gist.github.com/baryluk/70a99b5f26df4671378dd05afef97fce mksquashfs benchmarks]
See also: [https://gist.github.com/baryluk/70a99b5f26df4671378dd05afef97fce mksquashfs benchmarks]


Line 167: Line 173:
<!--T:17-->
<!--T:17-->
==See also==
==See also==
</translate>
<translate>
* [https://nixos.org/manual/nixos/stable/index.html#sec-building-image NixOS Manual: Building a NixOS (Live) ISO].
* [https://nixos.org/manual/nixos/stable/index.html#sec-building-image NixOS Manual: Building a NixOS (Live) ISO].
</translate>
</translate>