Created
June 28, 2020 21:01
-
-
Save konrad/1cda047021e1bfff621f45ab3d25069a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Script to run within the NixOS install image. | |
# | |
set -o errexit | |
readonly SWAP_SIZE_IN_GB=1 | |
parted /dev/sda -- mklabel gpt | |
parted /dev/sda -- mkpart primary 512MiB -1GiB | |
parted /dev/sda -- mkpart primary linux-swap -${SWAP_SIZE_IN_GB}GiB 100% | |
parted /dev/sda -- mkpart ESP fat32 ${SWAP_SIZE_IN_GB}MiB 512MiB | |
parted /dev/sda -- set 3 esp on | |
mkfs.ext4 -L nixos /dev/sda1 | |
mkswap -L swap /dev/sda2 | |
mkfs.fat -F 32 -n boot /dev/sda3 | |
mount /dev/disk/by-label/nixos /mnt | |
mkdir -p /mnt/boot | |
mount /dev/disk/by-label/boot /mnt/boot | |
swapon /dev/sda2 | |
nixos-generate-config --root /mnt | |
nixos-install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment