Compare commits

..

2 Commits

Author SHA1 Message Date
Sebastian Fischer
bb8b83274a [TASK] Improve scripts 2026-02-13 22:31:54 +01:00
Sebastian Fischer
38bb65f0e3 [TASK] Improve scripts 2026-02-13 22:02:11 +01:00
3 changed files with 36 additions and 10 deletions

View File

@ -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
@ -158,14 +159,16 @@ reboot
### 10. Post Installation ### 10. Post Installation
Generate SMB-credentials (if network mounts are used)
```bash ```bash
# SMB-Zugangsdaten einrichten (falls Netzlaufwerke genutzt werden)
sudo /etc/nixos/setup-smb-credentials.sh sudo /etc/nixos/setup-smb-credentials.sh
``` ```
## Wartung ## Wartung
Optimise Nix Store and remove old generations
```bash ```bash
# Nix Store optimieren und alte Generationen entfernen
sudo nix-store --optimise && sudo nix-collect-garbage -d sudo nix-store --optimise && sudo nix-collect-garbage -d
``` ```

View File

@ -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

View File

@ -4,7 +4,30 @@ 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
nixos-rebuild switch nixos-rebuild switch --option experimental-features "nix-command flakes"