Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50194 )
Change subject: [RFC] util/liveiso: Add initial NixOS config for corebootiso ......................................................................
[RFC] util/liveiso: Add initial NixOS config for corebootiso
Add a NixOS configuration for a bootable live system containing a set of tools which might be useful for working on firmware in general and coreboot.
It can be built using build-console.sh, which requires Nix utilities to be installed.
After building, the resulting iso image can be found in `result/iso/nixos.iso` and its size is about 676MB.
An additional configuration for a variant with Gnome Shell as window manager installed is WIP.
Change-Id: Iaf49d198e99781434bd89d2a8a125a4988b77e1c Signed-off-by: Felix Singer felixsinger@posteo.net --- A util/liveiso/build-console.sh A util/liveiso/console.nix A util/liveiso/description.md 3 files changed, 110 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/50194/1
diff --git a/util/liveiso/build-console.sh b/util/liveiso/build-console.sh new file mode 100755 index 0000000..45517dc --- /dev/null +++ b/util/liveiso/build-console.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage -I nixos-config=console.nix diff --git a/util/liveiso/console.nix b/util/liveiso/console.nix new file mode 100644 index 0000000..cd6e2fa --- /dev/null +++ b/util/liveiso/console.nix @@ -0,0 +1,106 @@ +{ config, pkgs, ... }: + +{ + imports = [ + <nixpkgs/nixos/modules/installer/cd-dvd/iso-image.nix> + ]; + + system.stateVersion = "20.09"; + + documentation.nixos.enable = false; + + isoImage.makeEfiBootable = true; + isoImage.makeUsbBootable = true; + boot.loader.grub.memtest86.enable = true; + boot.kernelParams = [ "console=ttyS0,115200" "console=tty0" ]; + + # pkgs.linuxPackages == lts + # pkgs.linuxPackages_latest == stable + boot.kernelPackages = pkgs.linuxPackages; + boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call chipsec ]; + + nixpkgs.config.allowUnfree = true; + hardware = { + cpu.intel.updateMicrocode = true; + cpu.amd.updateMicrocode = true; + enableAllFirmware = true; + }; + + networking = { + hostName = "corebootiso"; + networkmanager.enable = true; + }; + + services.openssh = { + enable = true; + permitRootLogin = "yes"; + }; + + services.mingetty.autologinUser = "user"; + security.sudo.wheelNeedsPassword = false; + users = { + groups.user = {}; + users.user = { + group = "user"; + home = "/home/user"; + createHome = true; + useDefaultShell = true; + extraGroups = [ "users" "wheel" "networkmanager" "uucp" ]; + initialHashedPassword = ""; + }; + users.root.initialHashedPassword = ""; + }; + + environment.systemPackages = with pkgs; [ + acpica-tools + btrfs-progs + bzip2 + ccrypt + chipsec + coreboot-utils + cryptsetup + curl + ddrescue + dosfstools + e2fsprogs + efibootmgr + efivar + exfat + f2fs-tools + flashrom + fuse + fuse3 + fwts + gitAndTools.gitFull + gitAndTools.tig + gptfdisk + gzip + hdparm + htop + jfsutils + mdadm + mkpasswd + ms-sys + neovim + ntfsprogs + p7zip + parted + pciutils + phoronix-test-suite + python3Full + rsync + screen + sdparm + smartmontools + socat + sshfs-fuse + testdisk + tmux + unzip + usbutils + wget + xfsprogs.bin + zip + zstd + ]; +} diff --git a/util/liveiso/description.md b/util/liveiso/description.md new file mode 100644 index 0000000..b9beac4 --- /dev/null +++ b/util/liveiso/description.md @@ -0,0 +1 @@ +Provides a configuration file for a NixOS live system with useful utilities pre-installed.