Compare commits

..

No commits in common. "cdb63d11149b6ece7879ef1f19e7c67219d3633e" and "4e3207dbc07cfc5c7375afb4410ea2d07121dfae" have entirely different histories.

2 changed files with 43 additions and 49 deletions

View File

@ -7,7 +7,8 @@ sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils vir
``` ```
- Video: QXL - Video: QXL
- If the HDD for the VM is too small: `qemu-img resize nixos.qcow2 +20G` - In `configuration.nix`: `services.spice-vdagentd.enable = true;`
- Falls die HDD zu klein ist: `qemu-img resize nixos.qcow2 +20G`
## Manuelle Installation (UEFI) ## Manuelle Installation (UEFI)
@ -19,7 +20,7 @@ sudo -i
# Use german keyboard layout # Use german keyboard layout
loadkeys de loadkeys de
# Short for all the stuff below !!! TAKE CARE OF THE USERDATA !!! # Short for all the stuff below !!! ONLY ON EMPTY DRIVES !!!
curl -L https://www.fischer.im/nixos/minimal-install --output install.sh curl -L https://www.fischer.im/nixos/minimal-install --output install.sh
chmod 744 ./install.sh chmod 744 ./install.sh
./install.sh ./install.sh
@ -31,7 +32,7 @@ If you don't use the installation script, you need to follow the steps 2-8
### 2. Partitionierung ### 2. Partitionierung
The following schema creates four partitions on `/dev/sda`: Das folgende Schema erstellt view Partitionen auf `/dev/sda`:
| Partition | Typ | Groesse | Mountpoint | | Partition | Typ | Groesse | Mountpoint |
|-------------|----------------|-------------------|------------| |-------------|----------------|-------------------|------------|
@ -40,26 +41,26 @@ The following schema creates four partitions on `/dev/sda`:
| `/dev/sda3` | ext4 (Root) | Rest minus Home | `/` | | `/dev/sda3` | ext4 (Root) | Rest minus Home | `/` |
| `/dev/sda4` | ext4 (Home) | 50% des Rests | `/home` | | `/dev/sda4` | ext4 (Home) | 50% des Rests | `/home` |
**HINT:** The sizes must be adapted to your hard drive. In the example it's assumed that a 100GB drive is in use. **Hinweis:** Die Groessen muessen an die eigene Festplatte angepasst werden. Im Beispiel wird eine 100 GB Festplatte verwendet.
```bash ```bash
# GPT-partition table # GPT-Partitionstabelle erstellen
parted /dev/sda -- mklabel gpt parted /dev/sda -- mklabel gpt
# EFI-partition (512 MB) # EFI-Partition (512 MB)
parted /dev/sda -- mkpart esp fat32 1MB 512MB parted /dev/sda -- mkpart esp fat32 1MB 512MB
parted /dev/sda -- set 1 esp on parted /dev/sda -- set 1 esp on
# Swap-partition (8 GB) # Swap-Partition (8 GB)
parted /dev/sda -- mkpart swap linux-swap 512MB 8626MB parted /dev/sda -- mkpart swap linux-swap 512MB 8626MB
# Root-partition (ca. 45 GB) # Root-Partition (ca. 45 GB)
parted /dev/sda -- mkpart root ext4 8636MB 40000MB parted /dev/sda -- mkpart root ext4 8636MB 40000MB
# Home-partition (Rest) # Home-Partition (Rest)
parted /dev/sda -- mkpart home ext4 40000MB 100% parted /dev/sda -- mkpart home ext4 40000MB 100%
# Check result # Ergebnis pruefen
parted /dev/sda -- print parted /dev/sda -- print
``` ```
@ -99,30 +100,28 @@ mount /dev/disk/by-label/home /mnt/home
swapon /dev/disk/by-label/swap swapon /dev/disk/by-label/swap
``` ```
### 6. Generate configuration ### 6. Konfiguration generieren
```bash ```bash
nixos-generate-config --root /mnt nixos-generate-config --root /mnt
``` ```
This creates two files: Dies erzeugt zwei Dateien:
- `/mnt/etc/nixos/hardware-configuration.nix`detected hardware and mountpoints - `/mnt/etc/nixos/hardware-configuration.nix`erkannte Hardware und Mountpoints
- `/mnt/etc/nixos/configuration.nix`Base configuration - `/mnt/etc/nixos/configuration.nix`Grundkonfiguration
### 7. Check the detected bootloader ### 7. Bootloader konfigurieren
Check inn `/mnt/etc/nixos/configuration.nix`, that the bootloader is configured like this: In `/mnt/etc/nixos/configuration.nix` sicherstellen, dass der Bootloader korrekt eingerichtet ist:
```nix ```nix
{
boot.loader = { boot.loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
}
``` ```
### 8. Install system ### 8. System installieren
```bash ```bash
nixos-install nixos-install

View File

@ -4,51 +4,46 @@ sudo -i
loadkeys de loadkeys de
lsblk lsbkl
# Disk selection
DEFAULT_DISK="/dev/sda"
read -p "Disk to install to [${DEFAULT_DISK}]: " DISK
DISK="${DISK:-$DEFAULT_DISK}"
if [ ! -b "$DISK" ]; then
echo "Error: ${DISK} is not a valid block device."
exit 1
fi
echo "Using disk: ${DISK}"
# Partitioning # Partitioning
read -p "Create partitions table? DELETES ALL DATA! (j/N): " answer read -p "Create partitions table? DELETES ALL DATA! (j/N): " answer
if [ "$answer" = "j" ] || [ "$answer" = "J" ]; then if [ "$answer" = "j" ] || [ "$answer" = "J" ]; then
# GPT-partition table # GPT-partition table creation
parted "${DISK}" -- mklabel gpt parted /dev/sda -- mklabel gpt
# EFI-partition (512 MB) # EFI-partition (512 MB)
parted "${DISK}" -- mkpart esp fat32 1MB 512MB parted /dev/sda -- mkpart esp fat32 1MB 512MB
parted "${DISK}" -- set 1 esp on parted /dev/sda -- set 1 esp on
# Swap-partition (8 GB) # Swap-partition (8 GB)
parted "${DISK}" -- mkpart swap linux-swap 512MB 8626MB parted /dev/sda -- mkpart swap linux-swap 512MB 8626MB
# Root-partition (ca. 45 GB) # Root-partition (ca. 45 GB)
parted "${DISK}" -- mkpart root ext4 8636MB 40000MB parted /dev/sda -- mkpart root ext4 8636MB 40000MB
# Home-partition (Rest) # Home-partition (Rest)
parted "${DISK}" -- mkpart home ext4 40000MB 100% parted /dev/sda -- mkpart home ext4 40000MB 100%
fi fi
# Check results # Check results
parted "${DISK}" -- print parted /dev/sda -- print
mkfs.fat -F 32 -n boot ${DISK}1
mkswap -L swap ${DISK}2
mkfs.ext4 -L nixos ${DISK}3
read -p "Format Home-partition? Deletes all userdata! (j/N): " answer # Format EFI-partition
mkfs.fat -F 32 -n boot /dev/sda1
# Format swap-partition
mkswap -L swap /dev/sda2
# Format root-partition
mkfs.ext4 -L nixos /dev/sda3
read -p "Home-Partition formatieren? LOESCHT BENUTZERDATEN! (j/N): " answer
if [ "$answer" = "j" ] || [ "$answer" = "J" ]; then if [ "$answer" = "j" ] || [ "$answer" = "J" ]; then
# Format home-partition # Format home-partition
mkfs.ext4 -L home ${DISK}4 mkfs.ext4 -L home /dev/sda4
fi fi
@ -70,7 +65,7 @@ nixos-install
# If root password wasn't set because the installation needed to be restarted. # If root password wasn't set because the installation needed to be restarted.
read -p "Set Root-password with nixos-enter? (j/N): " answer read -p "Root-Passwort mit nixos-enter setzen? (j/N): " answer
if [ "$answer" = "j" ] || [ "$answer" = "J" ]; then if [ "$answer" = "j" ] || [ "$answer" = "J" ]; then
nixos-enter --root '/mnt' nixos-enter --root '/mnt'
passwd passwd