dotfiles/fedora/up.sh

102 lines
4.1 KiB
Bash
Raw Normal View History

2019-03-04 14:36:40 +00:00
#!/usr/bin/env bash
2016-07-01 13:58:43 +01:00
set -e
2019-03-04 14:17:35 +00:00
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2019-03-04 12:38:53 +00:00
sudo dnf -y groupinstall "C Development Tools and Libraries"
sudo dnf -y groupinstall "Development Tools"
sudo dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf -y copr enable jdoss/wireguard
if [[ -z $NOUPGRADE ]]; then
2019-03-04 12:38:53 +00:00
sudo dnf -y groupupdate core
sudo dnf -y upgrade --best --allowerasing
fi
2016-10-08 07:08:17 +01:00
2019-06-08 09:34:59 +01:00
sudo dnf -y --best --allowerasing install tmux atop zsh firefox aria2 gajim lm_sensors freecad python3-pip qt5-qtbase-devel qt5-qtwebkit-devel whois curl pv gsmartcontrol python-pip mercurial python3-devel libxslt-devel libjpeg-turbo-devel cmake gtk2-devel intltool gparted glances dkms kernel-devel gimp git xz util-linux-user dnf-automatic kdiff3 yum-utils util-linux-user ncurses-devel qt5-linguist qtkeychain-qt5-devel archivemount keepass splix gutenprint-cups cups-bjnp golang redhat-rpm-config pcsc-lite-devel pcsc-tools pcsc-lite yubico-piv-tool yubikey-personalization-gui xloadimage yp-tools closure-compiler optipng jpegoptim grub2 grub2-efi dracut dracut-tools openssl-devel fail2ban syncthing ansible gnome-tweaks xclip wget wireguard-dkms wireguard-tools lldb python-lldb kdbg zlib-devel libuuid-devel libattr-devel libblkid-devel libselinux-devel libudev-devel parted lsscsi ksh openssl-devel elfutils-libelf-devel libtirpc-devel kernel-devel ffmpeg-libs dnf-plugins-core restic duply docker steam clang llvm-devel clang-devel libsodium-devel chromium vim tlp tlp-rdw
2016-08-01 06:29:33 +01:00
sudo cp -v /etc/dnf/automatic.conf /etc/dnf/automatic.conf.bak
sudo cp -v $DIR/etc/dnf/automatic.conf /etc/dnf/automatic.conf
sudo cp -v $DIR/etc/sysctl.d/90_swapiness.conf /etc/sysctl.d/
sudo cp -v $DIR/etc/sysctl.d/91_inotify_limit.conf /etc/sysctl.d/
sudo cp -v $DIR/etc/fail2ban/jail.d/01-sshd.conf /etc/fail2ban/jail.d/
2016-10-03 05:56:24 +01:00
sudo ldconfig
set +e
2016-08-01 06:29:33 +01:00
sudo diff /etc/dnf/automatic.conf.bak /etc/dnf/automatic.conf
set -e
2017-04-16 09:24:30 +01:00
# SSD TRIM
if [[ -f /etc/crypttab ]]; then
sudo cp -v /etc/crypttab /etc/crypttab.bak
sudo sed -i 's/none.*$/none luks,discard/g' /etc/crypttab
echo "crypttab:"
set +e
sudo cat /etc/crypttab
sudo diff /etc/crypttab.bak /etc/crypttab
set -e
else
echo "No crypttab..."
fi
if sudo test -f /boot/efi/EFI/fedora/grub.cfg; then
echo "generating grub config..."
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
echo "generating initramfs..."
sudo dracut -f
else
echo "No grub.cfg ..."
fi
2019-03-04 14:17:35 +00:00
mkdir -p "$HOME/.config/systemd/"
rm -frv "$HOME/.config/systemd/user"
DIR=`realpath "$DIR/../"`
ln -vfs "$DIR/.config/systemd/user" "$HOME/.config/systemd/"
2016-08-01 06:37:34 +01:00
if [[ -z $NO_SYSTEMCTL ]]; then
sudo systemctl enable docker
sudo systemctl restart docker
2017-08-05 19:47:49 +01:00
sudo systemctl enable fail2ban
sudo systemctl restart fail2ban
sudo systemctl enable dnf-automatic-install.timer
sudo systemctl restart dnf-automatic-install.timer
2017-04-16 09:24:30 +01:00
sudo systemctl enable fstrim.timer
sudo systemctl restart fstrim.timer
2019-06-08 09:34:59 +01:00
sudo systemctl enable tlp
sudo systemctl restart tlp
sudo systemctl enable tlp-sleep
sudo systemctl restart tlp-sleep
sudo systemctl mask systemd-rfkill.socket
2018-05-27 20:25:52 +01:00
sudo systemctl enable --now syncthing@cyryl.service
2019-03-04 14:17:35 +00:00
systemctl --user daemon-reload
systemctl --user enable restic-backup.timer
systemctl --user enable restic-backup.service
systemctl --user list-timers
2017-04-16 09:24:30 +01:00
sudo systemctl list-timers
fi
2015-08-01 19:17:56 +01:00
# docker
2016-12-29 19:08:49 +00:00
if [[ -z $USER ]]; then
USER=`whoami`
fi
getent group docker || sudo groupadd docker
sudo usermod -aG docker $USER
# vscode
2016-11-25 11:55:47 +00:00
mkdir -p ~/Downloads
2016-11-25 11:35:38 +00:00
cd ~/Downloads
2017-03-09 20:12:52 +00:00
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
sudo dnf -y install --best --allowerasing code
if [ "$(id -u)" != "0" ]; then
code --install-extension vscodevim.vim
fi
2016-11-25 11:35:38 +00:00
2019-05-19 21:41:17 +01:00
DIR="$DIR" "$DIR/common/up.sh"