Benutzer-Werkzeuge

Webseiten-Werkzeuge


notiz:nixos-tarball

Dies ist eine alte Version des Dokuments!


NixOS als Tarball

{ config, pkgs, modulesPath, ... }:

let
  # format target device with `mkfs.ext4 -L NIXOS_ROOT`
  rootfsLabel = "NIXOS_ROOT";
in {
  imports = [
    (modulesPath + "/installer/cd-dvd/system-tarball.nix")
    (modulesPath + "/virtualisation/xen-domU.nix")
    # (modulesPath + "/profiles/base.nix")
  ];

  tarball.contents = [
    {
      source = pkgs.writeText "grub.cfg" ''
        insmod gfxterm
        insmod png
        set gfxpayload=keep
        menuentry "NixOS" {
          search --set=drive1 --label ${rootfsLabel}
          linux ($drive1)${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
          initrd ($drive1)${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}
        }
      '';
      target = "/boot/grub.cfg";
    }
  ];

  fileSystems."/" = {
    device = "/dev/disk/by-label/${rootfsLabel}";
    fsType = "ext4";
  };
}
notiz/nixos-tarball.1610643730.txt.gz · Zuletzt geändert: 2021/01/14 18:02 von clerie

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki