-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·152 lines (130 loc) · 7.24 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/bin/bash
set -eux -o pipefail
# system info
rpm -qa | grep -E '^kernel-' | sort
cat /etc/os-release
gnome-shell --version
# remove unused repos
rm -f /etc/yum.repos.d/{rpmfusion-*,_copr:*}.repo
# enable rpm fusion repos: https://rpmfusion.org/Configuration
dnf install -y \
"https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" \
"https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
dnf config-manager setopt fedora-cisco-openh264.enabled=1
# install rpm fusion multimedia packages: https://rpmfusion.org/Howto/Multimedia
dnf swap -y ffmpeg-free ffmpeg --allowerasing
for cmd in install update; do
dnf "$cmd" -y @multimedia --setopt='install_weak_deps=False' --exclude='PackageKit-gstreamer-plugin'
done
dnf install -y intel-media-driver
dnf swap -y mesa-va-drivers mesa-va-drivers-freeworld
dnf swap -y mesa-vdpau-drivers mesa-vdpau-drivers-freeworld
dnf install -y rpmfusion-free-release-tainted
dnf install -y libdvdcss
dnf install -y rpmfusion-nonfree-release-tainted
dnf --repo='rpmfusion-nonfree-tainted' install -y '*-firmware'
# enable third-party repos
dnf config-manager addrepo --from-repofile='https://pkgs.tailscale.com/stable/fedora/tailscale.repo'
# install rpm packages
dnf install -y \
langpacks-{en,pt} \
zsh eza bat micro mc \
lsb_release fzf fd-find ripgrep tree ncdu tldr bc rsync tmux \
btop htop nvtop inxi lshw lm_sensors xclip xsel wl-clipboard expect \
sshuttle tailscale curl wget net-tools telnet traceroute bind-utils mtr nmap netcat tcpdump openssl \
whois iperf3 speedtest-cli wireguard-tools firewall-config syncthing \
bsdtar zstd p7zip{,-plugins} zip unzip unrar unar sqlite \
cmatrix lolcat fastfetch onefetch \
git{,-lfs,-delta} gh direnv jq yq stow \
distrobox podman{,-compose,-docker,-tui} \
gparted parted btrbk duperemove \
cups-pdf gnome-themes-extra gnome-tweaks tilix{,-nautilus} ffmpegthumbnailer \
openrgb steam-devices \
onedrive python3-{requests,pyside6} \
https://downloads.1password.com/linux/rpm/stable/x86_64/1password-cli-latest.x86_64.rpm \
https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
dnf remove -y \
gnome-software-fedora-langpacks gnome-terminal ptyxis
dnf autoremove -y
find /etc/ -type f -name '*.rpmnew' -delete
# install config files from ublue: https://github.com/ublue-os/packages
git clone --depth=1 https://github.com/ublue-os/packages.git ublue-packages
cp -a ublue-packages/packages/ublue-os-update-services/src/etc/rpm-ostreed.conf /etc/
cp -a ublue-packages/packages/ublue-os-update-services/src/usr/lib/systemd/system/rpm-ostreed-automatic.* /usr/lib/systemd/system/
cp -a ublue-packages/packages/ublue-os-update-services/src/usr/lib/systemd/system/flatpak-system-update.* /usr/lib/systemd/system/
cp -a ublue-packages/packages/ublue-os-update-services/src/usr/lib/systemd/user/flatpak-user-update.* /usr/lib/systemd/user/
sed -Ei 's|[^;&]*\bflatpak\b[^;&]+\brepair\b[^;&]*| /usr/bin/true |g' /usr/lib/systemd/{system,user}/flatpak-*-update.service
# enable update services
systemctl enable rpm-ostreed-automatic.timer
systemctl enable flatpak-system-update.timer
systemctl --global enable flatpak-user-update.timer
# disable gnome-software update service (already managed by previous services)
grep -ERl '^Exec.*\bgnome-software\b' /etc/xdg/autostart /usr/share/dbus-1/services | xargs rm -f
grep -ERl '^Exec.*\bgnome-software\b' /usr/share/applications | xargs sed -Ei '/^DBusActivatable/d'
# configure flatpak repos
systemctl disable flatpak-add-fedora-repos.service
curl -fsSL -o /etc/flatpak/remotes.d/flathub.flatpakrepo https://flathub.org/repo/flathub.flatpakrepo
# enable podman service
systemctl enable podman.socket
systemctl --global enable podman.socket
sed -Ei 's/(--filter\b)/--filter restart-policy=unless-stopped \1/g' /usr/lib/systemd/system/podman-restart.service
systemctl enable podman-restart.service
systemctl --global enable podman-restart.service
# disable ssh service by default
systemctl disable sshd.service
# enable tailscale service
systemctl enable tailscaled.service
# configure udisks2 from example config file
udisks2_generate() { ({ set +x; } &>/dev/null && echo "$(grep -Eo "\b$1=.+" /etc/udisks2/mount_options.conf.example | tail -n1),$2"); }
tee /etc/udisks2/mount_options.conf <<-EOF
[defaults]
$(udisks2_generate 'ntfs_defaults' 'dmask=0022,fmask=0133,noatime')
$(udisks2_generate 'exfat_defaults' 'dmask=0022,fmask=0133,noatime')
$(udisks2_generate 'vfat_defaults' 'dmask=0022,fmask=0133,noatime')
EOF
# configure gnome-disk-image-mounter to mount writable by default
sed -Ei 's/(^Exec=.*\bgnome-disk-image-mounter\b)/\1 --writable/g' /usr/share/applications/gnome-disk-image-mounter.desktop
# install fira-code nerd font from github releases
curl -fsSL -o fira-code.zip https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip
mkdir fira-code && bsdtar -xof fira-code.zip -C fira-code
mkdir -p /usr/share/fonts/nerd-fonts/fira-code
mv fira-code/*.ttf /usr/share/fonts/nerd-fonts/fira-code/
fc-cache -f
# install starship from github releases
curl -fsSL -o starship.tar.gz https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz
mkdir starship && bsdtar -xof starship.tar.gz -C starship
mv starship/starship /usr/bin/starship
chmod +x /usr/bin/starship
starship --version
# install cloudflared from github releases
curl -fsSL -o /usr/bin/cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64
chmod +x /usr/bin/cloudflared
cloudflared --version
# install mise from github releases
curl -fsSL https://api.github.com/repos/jdx/mise/releases/latest | jq -r '.assets[].browser_download_url' |
grep -E '/mise-[^/]+-linux-x64$' | head -n1 | xargs curl -fsSL -o /usr/bin/mise
chmod +x /usr/bin/mise
mise --version
# install onedrive-gui from github sources
curl -fsSL https://api.github.com/repos/bpozdena/OneDriveGUI/releases/latest | jq -r '.tarball_url' |
xargs curl -fsSL -o onedrive-gui.tar.gz
mkdir onedrive-gui && bsdtar -xof onedrive-gui.tar.gz -C onedrive-gui --strip-components=1
mv onedrive-gui/src /usr/lib/OneDriveGUI
# install warsaw: https://seg.bb.com.br/duvidas.html?question=10
curl -fsSL -o warsaw.run https://cloud.gastecnologia.com.br/bb/downloads/ws/fedora/warsaw_setup64.run
mkdir warsaw && bsdtar -xof warsaw.run -C warsaw --strip-components=1
dnf install -y warsaw/warsaw-*.x86_64.rpm
sed -E -e 's/multi-user.target/default.target/g' -e 's|(/var)?/run/|%t/|g' \
/usr/lib/systemd/system/warsaw.service >/usr/lib/systemd/user/warsaw.service
systemctl enable warsaw.service
systemctl --global enable warsaw.service
tee /usr/lib/tmpfiles.d/zz-warsaw.conf <<-'EOF'
C+ /var/usrlocal/bin/warsaw - - - - /usr/lib/usrlocal/bin/warsaw
C+ /var/usrlocal/etc/warsaw - - - - /usr/lib/usrlocal/etc/warsaw
C+ /var/usrlocal/lib/warsaw - - - - /usr/lib/usrlocal/lib/warsaw
EOF
# install canon printer drivers: https://tw.canon/en/support/0101230101
curl -fsSL -o canon.tar.gz https://gdlp01.c-wss.com/gds/1/0100012301/02/cnijfilter2-6.80-1-rpm.tar.gz
echo '55d807ef696053a3ae4f5bb7dd99d063d240bb13c95081806ed5ea3e81464876 canon.tar.gz' | sha256sum -c -
mkdir canon && bsdtar -xof canon.tar.gz -C canon --strip-components=1
dnf install -y canon/packages/cnijfilter2-*.x86_64.rpm