Skip to content

Instantly share code, notes, and snippets.

@memoryleak
Last active September 5, 2022 13:33
Show Gist options
  • Save memoryleak/8a2d49805092fa7a8f9527a1e2d86f96 to your computer and use it in GitHub Desktop.
Save memoryleak/8a2d49805092fa7a8f9527a1e2d86f96 to your computer and use it in GitHub Desktop.
# Use network installation
url --mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch"
repo --name="updates" --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
repo --name="fedora-cisco-openh264" --metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-$releasever&arch=$basearch
repo --name="microsoft-teams" --baseurl=https://packages.microsoft.com/yumrepos/ms-teams
repo --name="microsoft-vscode" --baseurl=https://packages.microsoft.com/yumrepos/vscode
repo --name="microsoft-dotnet" --baseurl=https://packages.microsoft.com/yumrepos/microsoft-fedora$releasever-prod
repo --name="microsoft-edge" --baseurl=https://packages.microsoft.com/yumrepos/edge
repo --name="sublime-text" --baseurl=https://download.sublimetext.com/rpm/stable/$basearch
repo --name="rpmfusion-free" --baseurl=http://mirror.nudorm.net/rpmfusion/free/fedora/releases/$releasever/Everything/$basearch/os
repo --name="rpmfusion-nonfree" --baseurl=http://mirror.nudorm.net/rpmfusion/nonfree/fedora/releases/$releasever/Everything/$basearch/os
repo --name="rpmfusion-free-updates" --baseurl=http://mirror.nudorm.net/rpmfusion/free/fedora/updates/$releasever/$basearch
repo --name="rpmfusion-nonfree-updates" --baseurl=http://mirror.nudorm.net/rpmfusion/nonfree/fedora/updates/$releasever/$basearch
repo --name="hashicorp" --baseurl=https://rpm.releases.hashicorp.com/fedora/$releasever/$basearch/stable
%pre
echo "max_parallel_downloads=20" >> /etc/dnf/dnf.conf
%end
%post
# Set nopasswd for wheel
echo "%wheel ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/wheel
# Set a fancier PS1 prompt
cat <<EOF > /etc/profile.d/ps1.sh
PS1="\[\e[32m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\]:[\[\e[35m\]\W\[\e[m\]]: "
EOF
# Set user file limits
echo "DefaultLimitNOFILE=1024:524288" >> /etc/systemd/user.conf
# Download packages in parallel
echo "max_parallel_downloads=20" >> /etc/dnf/dnf.conf
# Bash history settings
cat <<EOF > /etc/profile.d/bash_history.sh
HISTSIZE=10000
HISTFILESIZE=2000000
shopt -s histappend
HISTCONTROL=ignoreboth
HISTIGNORE='ls:ll:ls -alh:pwd:clear:history'
HISTTIMEFORMAT='%F %T '
shopt -s cmdhist
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
EOF
echo >> "PermitRootLogin prohibit-password" >> /etc/ssh/sshd_config
sed -i 's/apply_updates = no/apply_updates = yes/g' /etc/dnf/automatic.conf
systemctl enable dnf-automatic.timer
%end
%post
# Explicitly set graphical.target as default as this is how initial-setup detects which version to run
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
%end
%post
cat <<EOF > /etc/yum.repos.d/microsoft-teams.repo
[microsoft-teams]
name=Microsoft Teams
baseurl=https://packages.microsoft.com/yumrepos/ms-teams
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
sslverify=1
EOF
cat <<EOF > /etc/yum.repos.d/microsoft-vscode.repo
[microsoft-vscode]
name=Microsoft VSCode
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
sslverify=1
EOF
cat <<EOF > /etc/yum.repos.d/microsoft-dotnet.repo
[microsoft-dotnet]
name=Microsoft DotNET
baseurl=https://packages.microsoft.com/yumrepos/microsoft-fedora\$releasever-prod/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
sslverify=1
EOF
dnf install 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 --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
rm awscliv2.zip
%end
%packages
@^kde-desktop-environment
@c-development
@libreoffice
@virtualization
ImageMagick
arj
avahi-devel
avahi-tools
bzip2
code
compat-ffmpeg4
composer
cups
cups-devel
dnf-automatic
docker-compose
fedora-release-kde
ffmpeg
firefox
git
gstreamer1-libav
gstreamer1-plugin-openh264
gstreamer1-plugins-bad-freeworld
gstreamer1-plugins-ugly
gzip
hplip
hplip-gui
java-latest-openjdk
java-latest-openjdk-javadoc
java-latest-openjdk-src
kompare
krename
lha
libjpeg-devel
libusb1-devel
lm_sensors-sensord
lnav
lzma
mediawriter
microsoft-edge-stable
moby-engine
mozilla-openh264
net-snmp-devel
nfs-utils
openh264
openjfx
openjfx-devel
openssl-devel
p7zip
packer
parallel
parzip
pbzip2
php-cli
pigz
pipenv
pv
python3-PyQt4
python3-devel
python3-notify2
qt5-qtwebengine-freeworld
sane-backends
sane-backends-devel
sublime-text
tar
teams
terraform
texstudio
unace
unarj
unrar
unzip
vim
virt-top
x264
xsane
xz
yakuake
zip
{
"bip": "172.16.0.1/16",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "devicemapper"
}
cat <<EOF > /etc/yum.repos.d/microsoft-teams.repo
[microsoft-teams]
name=Microsoft Teams
baseurl=https://packages.microsoft.com/yumrepos/ms-teams
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
sslverify=1
EOF
cat <<EOF > /etc/yum.repos.d/microsoft-vscode.repo
[microsoft-vscode]
name=Microsoft VSCode
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
sslverify=1
EOF
cat <<EOF > /etc/yum.repos.d/microsoft-dotnet.repo
[microsoft-dotnet]
name=Microsoft DotNET
baseurl=https://packages.microsoft.com/yumrepos/microsoft-fedora\$releasever-prod/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
sslverify=1
EOF
dnf install 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 --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
rm awscliv2.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment