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.

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