Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.8 KiB

  1. #!/bin/bash
  2. ln -sf /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
  3. hwclock --systohc
  4. echo -e "en_US.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8" > /etc/locale.gen
  5. locale-gen
  6. echo "LANG=en_US.UTF-8" > /etc/locale.conf
  7. curl https://blackarch.org/strap.sh > /tmp/strap.sh
  8. chmod +x /tmp/strap.sh
  9. /tmp/strap.sh
  10. echo "tatooine" > /etc/hostname
  11. systemctl enable fstrim.timer
  12. echo -e "127.0.0.1 localhost\n::1 localhost\n127.0.0.1 tatooine.localdomain tatooine" > /etc/hosts
  13. cat << EOF > /etc/mkinitcpio.conf
  14. MODULES=(vfat i915)
  15. BINARIES=()
  16. FILES=()
  17. HOOKS=(base udev plymouth autodetect keyboard keymap consolefont modconf block plymouth-encrypt openswap resume filesystems fsck)
  18. EOF
  19. cat << EOF > /etc/initcpio/hooks/openswap
  20. run_hook ()
  21. {
  22. x=0;
  23. while [ ! -b /dev/mapper/root ] && [ \$x -le 10 ]; do
  24. x=$((x+1))
  25. sleep .2
  26. done
  27. mkdir crypto_key_device
  28. mount /dev/mapper/root crypto_key_device
  29. cryptsetup open --key-file crypto_key_device/root/.keys/swap-keyfile $(cat /install/device)2 swap
  30. umount crypto_key_device
  31. }
  32. EOF
  33. cat << EOF > /etc/initcpio/install/openswap
  34. build ()
  35. {
  36. add_runscript
  37. }
  38. help ()
  39. {
  40. cat<<HELPEOF
  41. This opens the swap encrypted partition $(cat /install/device)2 in /dev/mapper/swap
  42. HELPEOF
  43. }
  44. EOF
  45. line=1
  46. blkid | while IFS= read -r i; do
  47. echo "$line: $i"
  48. ((line=line+1))
  49. done
  50. echo "Please select the device you will save the LUKS key to:"
  51. read keydev
  52. uuid=$(blkid | sed -n 's/.*UUID=\"\([^\"]*\)\".*/\1/p' | sed -n "$keydev"p)
  53. cat << EOF > /boot/refind_linux.conf
  54. "Boot with encryption" "root=/dev/mapper/root resume=/dev/mapper/swap cryptdevice=UUID=$(blkid -s UUID -o value $(cat /install/device)3):root:allow-discards cryptkey=UUID=$uuid:vfat:key.yeet rw loglevel=3 quiet splash"
  55. EOF
  56. xargs pacman -S --needed --noconfirm $(/install/nonAUR.txt)
  57. refind-install
  58. echo "Please enter name for regular user:"
  59. read username
  60. useradd -m $username
  61. echo "Set password for user $username: "
  62. passwd $username
  63. sudo -u $username bash -c "yay -S plymouth"
  64. sudo -u $username bash -c "git clone https://aur.archlinux.org/yay.git /tmp/yay"
  65. sudo -u $username bash -c "(cd /tmp/yay; makepkg -si)"
  66. sudo -u $username bash -c "git clone --recurse-submodules https://github.com/theFr1nge/dotfiles.git ~/.dotfiles"
  67. sudo -u $username bash -c "(cd ~/.dotfiles; ./install.sh)"
  68. git clone https://github.com/adi1090x/plymouth-themes.git /tmp/pthemes
  69. cat << EOF > /etc/plymouth/plymouthd.conf
  70. [Daemon]
  71. Theme=sphere
  72. ShowDelay=0
  73. DeviceTimeout=8
  74. EOF
  75. cp -r /tmp/pthemes/pack_4/sphere /usr/share/plymouth/themes
  76. echo -e "/boot/EFI/refind\n2\n2" | sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/bobafetthotmail/refind-theme-regular/master/install.sh)"
  77. systemctl enable NetworkManager
  78. systemctl enable ly
  79. mkinitcpio -P
  80. vim /etc/fstab
  81. pacman -R nano # uninstall nano, eww
  82. echo "SETUP COMPLETE"
  83. exit