62 lines
1.1 KiB
Bash
62 lines
1.1 KiB
Bash
#!/usr/bin/env sh
|
|
|
|
sudo -i
|
|
|
|
loadkeys de
|
|
|
|
lsbkl
|
|
|
|
|
|
# GPT-Partitionstabelle erstellen
|
|
parted /dev/sda -- mklabel gpt
|
|
|
|
# EFI-Partition (512 MB)
|
|
parted /dev/sda -- mkpart esp fat32 1MB 512MB
|
|
parted /dev/sda -- set 1 esp on
|
|
|
|
# Swap-Partition (8 GB)
|
|
parted /dev/sda -- mkpart swap linux-swap 512MB 8626MB
|
|
|
|
# Root-Partition (ca. 45 GB)
|
|
parted /dev/sda -- mkpart root ext4 8636MB 40000MB
|
|
|
|
# Home-Partition (Rest)
|
|
parted /dev/sda -- mkpart home ext4 40000MB 100%
|
|
|
|
# Ergebnis pruefen
|
|
parted /dev/sda -- print
|
|
|
|
|
|
# EFI-Partition formatieren
|
|
mkfs.fat -F 32 -n boot /dev/sda1
|
|
|
|
# Swap-Partition formatieren
|
|
mkswap -L swap /dev/sda2
|
|
|
|
# Root-Partition formatieren
|
|
mkfs.ext4 -L nixos /dev/sda3
|
|
|
|
# Home-Partition formatieren
|
|
mkfs.ext4 -L home /dev/sda4
|
|
|
|
|
|
# Root mounten
|
|
mount /dev/disk/by-label/nixos /mnt
|
|
|
|
# Boot-Verzeichnis erstellen und mounten
|
|
mkdir /mnt/boot
|
|
mount -o umask=077 /dev/disk/by-label/boot /mnt/boot
|
|
|
|
# Home-Verzeichnis erstellen und mounten
|
|
mkdir -p /mnt/home
|
|
mount /dev/disk/by-label/home /mnt/home
|
|
|
|
# Swap aktivieren
|
|
swapon /dev/disk/by-label/swap
|
|
|
|
|
|
nixos-generate-config --root /mnt
|
|
|
|
nixos-enter --root '/mnt'
|
|
passwd
|