Creating a NixOS live CD: Difference between revisions

imported>Mic92
No edit summary
imported>Mic92
Line 10: Line 10:
Create a file "iso.nix":
Create a file "iso.nix":


# This module defines a small NixOS installation CD.  It does not
<syntaxhighlight lang="nix">
# contain any graphical stuff.
# This module defines a small NixOS installation CD.  It does not
{config, pkgs, ...}:
# contain any graphical stuff.
{
{config, pkgs, ...}:
  imports = [
{
      <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
  imports = [
    # Provide an initial copy of the NixOS channel so that the user
    <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
    # doesn't need to run "nix-channel --update" first.
    # Provide an initial copy of the NixOS channel so that the user
      <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
    # doesn't need to run "nix-channel --update" first.
  ];
    <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
}
  ];
}
</syntaxhighlight>


Build the image via:
Build the image via:
  nix-build -A config.system.build.isoImage -I nixos-config=iso.nix  /path/to/nixpkgs/nixos
 
<syntaxhighlight lang="bash">
nix-build -A config.system.build.isoImage -I nixos-config=iso.nix  /path/to/nixpkgs/nixos
</syntaxhighlight>


=== Start SSH with your SSH key ===
=== Start SSH with your SSH key ===