diff --git a/README.md b/README.md index 2fb2a8d..059c785 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ This creates two files: ### 7. Check the detected bootloader -Check inn `/mnt/etc/nixos/configuration.nix`, that the bootloader is configured like this: +Check in `/mnt/etc/nixos/configuration.nix`, that the bootloader is configured like this: ```nix { @@ -132,7 +132,7 @@ nixos-install reboot ``` -### 9. Nach dem ersten Start +### 9. After the first reboot ```bash curl --output release.tar.gz https://gitea.fischer.im/sebastian/nixos-cesium/archive/[0.0.2].tar.gz @@ -140,6 +140,7 @@ tar xzf release.tar.gz chmod 744 nixos-cesium/script/post-install.sh ./nixos-cesium/script/post-install.sh ``` + If you don't use the post-installation script, follow the next step ```bash diff --git a/scripts/minimal-install.sh b/scripts/minimal-install.sh index 623a60c..179cb28 100755 --- a/scripts/minimal-install.sh +++ b/scripts/minimal-install.sh @@ -11,7 +11,7 @@ DEFAULT_DISK="/dev/sda" read -p "Disk to install to [${DEFAULT_DISK}]: " DISK DISK="${DISK:-$DEFAULT_DISK}" -if [ ! -b "$DISK" ]; then +if [ ! -b "${DISK}" ]; then echo "Error: ${DISK} is not a valid block device." exit 1 fi @@ -19,8 +19,8 @@ fi echo "Using disk: ${DISK}" # Partitioning -read -p "Create partitions table? DELETES ALL DATA! (j/N): " answer -if [ "$answer" = "j" ] || [ "$answer" = "J" ]; then +read -p "Create partitions table? DELETES ALL DATA! (j/N): " ANSWER +if [ "${ANSWER}" = "j" ] || [ "${ANSWER}" = "J" ]; then # GPT-partition table parted "${DISK}" -- mklabel gpt @@ -45,8 +45,8 @@ 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 -if [ "$answer" = "j" ] || [ "$answer" = "J" ]; then +read -p "Format Home-partition? Deletes all userdata! (j/N): " ANSWER +if [ "${ANSWER}" = "j" ] || [ "${ANSWER}" = "J" ]; then # Format home-partition mkfs.ext4 -L home ${DISK}4 fi diff --git a/scripts/post-install.sh b/scripts/post-install.sh index 9d354ef..58e974b 100755 --- a/scripts/post-install.sh +++ b/scripts/post-install.sh @@ -4,6 +4,29 @@ sudo -i cp -r ~/nixos-cesium/config/* /etc/nixos/ +# VM module activation +echo "" +echo "Activate a VM module?" +echo " 1) vm-guest.nix (VM runs inside a hypervisor)" +echo " 2) vm-host.nix (System runs VMs via libvirtd)" +echo " n) None" +read -p "Selection [n]: " VM_CHOICE +VM_CHOICE="${VM_CHOICE:-n}" + +case "${VM_CHOICE}" in + 1) + sed -i 's|# ./vm-guest.nix|./vm-guest.nix|' /etc/nixos/configuration.nix + echo "vm-guest.nix activated." + ;; + 2) + sed -i 's|# ./vm-guest.nix|./vm-host.nix|' /etc/nixos/configuration.nix + echo "vm-host.nix activated." + ;; + *) + echo "No VM module activated." + ;; +esac + nix-channel --add https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz home-manager nix-channel --update