2022-05-26 16:43:33 -04:00
#!/bin/bash
2023-09-27 03:58:33 -04:00
# Copyright (C) 2023 Thien Tran
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
2024-01-24 19:44:48 -05:00
unpriv( ) {
sudo -u nobody " $@ "
}
# Avoid phased updates
unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/apt/apt.conf.d/99sane-upgrades | sudo tee /etc/apt/apt.conf.d/99sane-upgrades
sudo chmod 644 /etc/apt/apt.conf.d/99sane-upgrades
# Adding KickSecure's signing key
2022-05-26 16:43:33 -04:00
curl --proxy http://127.0.0.1:8082/ --tlsv1.3 --proto = https --max-time 180 --output ~/derivative.asc https://www.kicksecure.com/derivative.asc
sudo cp ~/derivative.asc /usr/share/keyrings/derivative.asc
echo "deb [signed-by=/usr/share/keyrings/derivative.asc] https://deb.kicksecure.com bullseye main contrib non-free" | sudo tee /etc/apt/sources.list.d/derivative.list
2022-06-14 21:44:38 -04:00
sudo apt update
2022-05-26 16:43:33 -04:00
2024-01-24 19:44:48 -05:00
# Debloat
2022-05-26 22:31:56 -04:00
sudo apt purge -y thunderbird emacs emacs-gtk emacs-bin-common emacs-common firefox* keepassxc cups* system-config-printer* xsettingsd yelp*
2022-05-26 16:52:43 -04:00
sudo apt autoremove -y
sudo apt autoclean
2024-01-24 19:44:48 -05:00
# Distribution morphing
2023-01-16 00:43:14 -05:00
sudo apt install --no-install-recommends kicksecure-qubes-cli gnome-settings-daemon -y
2022-05-26 22:31:56 -04:00
sudo apt autoremove -y
2022-05-26 16:43:33 -04:00
sudo mv /etc/apt/sources.list ~/
sudo touch /etc/apt/sources.list
2024-01-24 19:44:48 -05:00
#E nabling SUID Disabler and Permission Hardener
2022-05-26 16:43:33 -04:00
sudo systemctl enable --now permission-hardening
2024-01-24 19:44:48 -05:00
# Restrict /proc and access
2022-07-02 21:49:05 -04:00
sudo systemctl enable --now proc-hidepid.service
2024-01-24 19:44:48 -05:00
# educe kernel information leaks
# Will break a lot of applications. The apps I use on KickSecure work fine with it so I am enabling it.
2022-05-26 16:43:33 -04:00
sudo systemctl enable --now hide-hardware-info.service
2024-01-24 19:44:48 -05:00
# Install packages
2024-01-19 03:37:45 -05:00
sudo apt install --no-install-recommends tirdad qubes-gpg-split qubes-u2f eog qt5ct qt5-style-plugins arc-theme -y
2022-05-26 16:43:33 -04:00
2024-01-24 19:44:48 -05:00
# Setup SSH client
2023-01-18 08:12:34 -05:00
echo "GSSAPIAuthentication no" | sudo tee /etc/ssh/ssh_config.d/10-custom.conf
echo "VerifyHostKeyDNS yes" | sudo tee -a /etc/ssh/ssh_config.d/10-custom.conf
2024-01-24 19:44:48 -05:00
# Force DNSSEC
2023-01-18 08:12:34 -05:00
sudo sed -i 's/#DNSSEC=no/DNSSEC=yes/g' /etc/systemd/resolved.conf
sudo systemctl restart systemd-resolved
2024-01-24 19:44:48 -05:00
# Theming
2022-05-26 16:43:33 -04:00
2022-05-26 17:39:47 -04:00
echo "export QT_QPA_PLATFORMTHEME=gtk2" | sudo tee /etc/environment
2022-05-26 16:43:33 -04:00
2023-01-16 01:05:39 -05:00
echo " [org/gnome/desktop/interface]
gtk-theme= 'Arc-Dark'
[ org/gnome/desktop/media-handling]
automount = false
automount-open= false" | sudo tee /etc/dconf/db/local.d/custom
sudo dconf update
2022-05-26 16:43:33 -04:00
2024-01-24 19:44:48 -05:00
# Flatpak update service
2022-05-26 16:43:33 -04:00
2022-05-26 17:39:47 -04:00
echo " [Unit]
2022-05-26 16:43:33 -04:00
Description = Update user Flatpaks
[ Service]
Type = oneshot
2024-04-26 18:58:16 -04:00
ExecStart = /usr/bin/flatpak --user update -y" | sudo tee /etc/systemd/user/update-user-flatpaks.service
2022-05-26 16:43:33 -04:00
2022-05-26 17:39:47 -04:00
echo " [Unit]
2022-05-26 16:43:33 -04:00
Description = Update user Flatpaks daily
[ Timer]
OnCalendar = daily
Persistent = true
[ Install]
2023-01-18 08:12:34 -05:00
WantedBy = timers.target" | sudo tee /etc/systemd/user/update-user-flatpaks.timer