[TASK] Improve scripts
This commit is contained in:
parent
cdb63d1114
commit
38bb65f0e3
@ -111,7 +111,7 @@ This creates two files:
|
|||||||
|
|
||||||
### 7. Check the detected bootloader
|
### 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
|
```nix
|
||||||
{
|
{
|
||||||
@ -132,7 +132,7 @@ nixos-install
|
|||||||
reboot
|
reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
### 9. Nach dem ersten Start
|
### 9. After the first reboot
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl --output release.tar.gz https://gitea.fischer.im/sebastian/nixos-cesium/archive/[0.0.2].tar.gz
|
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
|
chmod 744 nixos-cesium/script/post-install.sh
|
||||||
./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
|
If you don't use the post-installation script, follow the next step
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@ -11,7 +11,7 @@ DEFAULT_DISK="/dev/sda"
|
|||||||
read -p "Disk to install to [${DEFAULT_DISK}]: " DISK
|
read -p "Disk to install to [${DEFAULT_DISK}]: " DISK
|
||||||
DISK="${DISK:-$DEFAULT_DISK}"
|
DISK="${DISK:-$DEFAULT_DISK}"
|
||||||
|
|
||||||
if [ ! -b "$DISK" ]; then
|
if [ ! -b "${DISK}" ]; then
|
||||||
echo "Error: ${DISK} is not a valid block device."
|
echo "Error: ${DISK} is not a valid block device."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -19,8 +19,8 @@ fi
|
|||||||
echo "Using disk: ${DISK}"
|
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
|
||||||
parted "${DISK}" -- mklabel gpt
|
parted "${DISK}" -- mklabel gpt
|
||||||
|
|
||||||
@ -45,8 +45,8 @@ mkfs.fat -F 32 -n boot ${DISK}1
|
|||||||
mkswap -L swap ${DISK}2
|
mkswap -L swap ${DISK}2
|
||||||
mkfs.ext4 -L nixos ${DISK}3
|
mkfs.ext4 -L nixos ${DISK}3
|
||||||
|
|
||||||
read -p "Format Home-partition? Deletes all userdata! (j/N): " answer
|
read -p "Format Home-partition? Deletes all userdata! (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 ${DISK}4
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -4,6 +4,29 @@ sudo -i
|
|||||||
|
|
||||||
cp -r ~/nixos-cesium/config/* /etc/nixos/
|
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 --add https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz home-manager
|
||||||
nix-channel --update
|
nix-channel --update
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user