Skip to content

Commit

Permalink
Forgot to add files
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ngr31 committed Jan 20, 2024
1 parent fa03b71 commit 9053187
Show file tree
Hide file tree
Showing 29 changed files with 652 additions and 0 deletions.
130 changes: 130 additions & 0 deletions config/common-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
type: akmods
install:
- v4l2loopback
- xone
- xpadneo
- xpad-noone
- winesync

type: files
files:
- usr: /usr
- etc: /etc

type: initramfs-setup
include:
- /etc/crypttab
- /etc/vconsole.conf
- /etc/modprobe.d/modprobe-gidro.conf

type: rpm-ostree
repos:
- https://copr.fedorainfracloud.org/coprs/kylegospo/system76-scheduler/repo/fedora-%OS_VERSION%/kylegospo-system76-scheduler-fedora-%OS_VERSION%.repo
- https://copr.fedorainfracloud.org/coprs/szydell/system76/repo/fedora-%OS_VERSION%/szydell-system76-fedora-%OS_VERSION%.repo
- https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-%OS_VERSION%/ublue-os-staging-fedora-%OS_VERSION%.repo

install:
- gnome-shell-extension-caffeine
- system76-scheduler
- gnome-shell-extension-system76-scheduler
- system76-power
- android-tools
- nerd-fonts
- zsh
- gnome-boxes
- code
- docker-ce
- docker-ce-cli
- docker-buildx-plugin
- docker-compose-plugin
- containerd.io
- p7zip
- p7zip-plugins
- podman-compose
- podman-plugins
- podman-tui
- podmansh
- playerctl
- nautilus-gsconnect
- gnome-shell-extension-gsconnect
- python3-pip
- samba
- samba-dcerpc
- samba-ldb-ldap-modules
- samba-winbind-clients
- samba-winbind-modules
- konsole
- libvirt

remove:
- firefox
- firefox-langpacks
- htop
- nvtop
- gnome-software-rpm-ostree
- gnome-tour
- gnome-initial-setup
- gnome-system-monitor
- gnome-classic-session
- gnome-extensions-app

type: bling
install:
- dconf-update-service
- ublue-os-wallpapers
- ublue-update
- container-tools

type: yafti
custom-flatpaks:

type: default-flatpaks
notify: true
system:
repo-url: https://dl.flathub.org/repo/flathub.flatpakrepo
repo-name: flathub-system
repo-title: "Flathub (System)" # Optional; this sets the remote's user-facing name in graphical frontends like GNOME Software
install:
- org.gnome.Calculator
- org.gnome.Calendar
- org.gnome.Snapshot
- org.gnome.Contacts
- org.gnome.clocks
- org.gnome.Evince
- org.gnome.Maps
- org.gnome.TextEditor
- com.github.neithern.g4music
- com.github.rafostar.Clapper
- org.gnome.Loupe
- io.missioncenter.MissionCenter
- com.vixalien.sticky
- com.github.tchx84.Flatseal
- io.github.fabrialberio.pinapp
- com.mattjakeman.ExtensionManager
- io.podman_desktop.PodmanDesktop
- com.uploadedlobster.peek
- org.mozilla.firefox
user:
repo-url: https://dl.flathub.org/repo/flathub.flatpakrepo
repo-name: flathub-user
repo-title: "Flathub"

type: systemd
system:
enabled:
- initramfs-setup.service
- minimum-free-zram.service
- com.system76.PowerDaemon.service
- system76-power-wake.service
- com.system76.Scheduler.service
masked:
- power-profiles-daemon.service
user:
enabled:
- podman.socket
- docker.socket

type: script
scripts:
- system76-scheduler.sh
- signing.sh
6 changes: 6 additions & 0 deletions config/files/etc/yum.repos.d/docker-ce.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/fedora/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
6 changes: 6 additions & 0 deletions config/files/etc/yum.repos.d/vscode.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
24 changes: 24 additions & 0 deletions config/files/usr/bin/dx-groups
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

# SCRIPT VERSION
GROUP_SETUP_VER=1
GROUP_SETUP_VER_FILE="/etc/ublue/dx-groups"
GROUP_SETUP_VER_RAN=$(cat "$GROUP_SETUP_VER_FILE")

# Run script if updated
if [[ -f $GROUP_SETUP_VER_FILE && "$GROUP_SETUP_VER" = "$GROUP_SETUP_VER_RAN" ]]; then
echo "Group setup has already run. Exiting..."
exit 0
fi

# Setup Groups
wheelarray=($(getent group wheel | cut -d ":" -f 4 | tr ',' '\n'))
for user in $wheelarray
do
usermod -aG docker $user
usermod -aG libvirt $user
done

# Prevent future executions
echo "Writing state file"
echo "$GROUP_SETUP_VER" > "$GROUP_SETUP_VER_FILE"
40 changes: 40 additions & 0 deletions config/files/usr/bin/dx-user-vscode
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

# SCRIPT VERSION
USER_SETUP_VER=2
USER_SETUP_VER_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/ublue/vscode-configured"
USER_SETUP_VER_RAN=$(cat "$USER_SETUP_VER_FILE")

mkdir -p "$(dirname "$USER_SETUP_VER_FILE")" || exit 1

USER_SETUP_VER_FILE_V1="$HOME/.bluefin-vscode-configured"
# Upgrade from v1 to v2 changes only the location of the USER_SETUP_VER.
# Exit if v1 file is present.
if [[ -f $USER_SETUP_VER_FILE_V1 ]]; then
echo "User setup v1 has already run. Exiting..."
rm $USER_SETUP_VER_FILE_V1
echo "$USER_SETUP_VER" > "$USER_SETUP_VER_FILE"
exit 0
fi

# Run script if updated
if [[ -f $USER_SETUP_VER_FILE && "$USER_SETUP_VER" = "$USER_SETUP_VER_RAN" ]]; then
echo "User setup v$VER has already run. Exiting..."
exit 0
fi

# Setup VSCode
# Pre-install preferred VSCode Extensions
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-azuretools.vscode-docker
code --install-extention trongthanh.theme-boxythemekit
code --install-extention EditorConfig.EditorConfig
code --install-extention dbaeumer.vscode-eslint
code --install-extention drKnoxy.eslint-disable-snippets
code --install-extention eamodio.gitlens
code --install-extention esbenp.prettier-vscode
code --install-extention ms-vscode-remote.remote-ssh

# Prevent future executions
echo "Writing state file"
echo "$USER_SETUP_VER" > "$USER_SETUP_VER_FILE"
113 changes: 113 additions & 0 deletions config/files/usr/bin/initramfs-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/usr/bin/env bash

# Global variables - Needed initramfs file arguments contain tracked file arguments dictated by the module & by the live-user
tracked_file="/etc/ublue-os/initramfs/tracked"
custom_tracked_file="/etc/ublue-os/initramfs/tracked-custom"
readarray -t current < <(rpm-ostree initramfs-etc | tr -d ' ' | tail -n +2)
readarray -t needed < <(grep -v -E '^#|^$' "$tracked_file" && grep -v -E '^#|^$' "$custom_tracked_file")
applies_tracking=false
applies_untracking=false
dracut_tracked_file="/etc/ublue-os/initramfs/dracut-tracked"
dracut_custom_tracked_file="/etc/ublue-os/initramfs/dracut-tracked-custom"
readarray -t dracut_current < <(ls -A /etc/dracut.conf.d)
readarray -t dracut_needed < <(grep -v -E '^#|^$' "$dracut_tracked_file" && grep -v -E '^#|^$' "$dracut_custom_tracked_file")
applies_dracut=false

# Print current dracut file configs
printf "Current dracut file configs:\n"
for current_file in "${dracut_current[@]}"; do
printf "%s\n" "$current_file"
done

# Print current initramfs file arguments
printf "Current initramfs:\n"
for current_file in "${current[@]}"; do
printf "%s\n" "$current_file"
done

# If current dracut is missing needed file arguments, make it ready for tracking
for needed_arg in "${dracut_needed[@]}"; do
found=false
for current_arg in "${dracut_current[@]}"; do
if [[ "$current_arg" == "$needed_arg" ]]; then
found=true
break
fi
done
if ! $found; then
applies_dracut=true
fi
done

# If current initramfs is missing needed file arguments, make them ready for tracking
for needed_arg in "${needed[@]}"; do
found=false
for current_arg in "${current[@]}"; do
if [[ "$current_arg" == "$needed_arg" ]]; then
found=true
break
fi
done
if ! $found; then
applies_tracking=true
fi
done

# If there are file arguments in current initramfs, that are not present in needed initramfs, make them ready for untracking
for current_arg in "${current[@]}"; do
found=false
for needed_arg in "${needed[@]}"; do
if [[ "$needed_arg" == "$current_arg" ]]; then
found=true
break
fi
done
if ! $found; then
applies_untracking=true
untracked+=("$current_arg")
fi
done

# Apply --track= & --untrack= prefixes to tracked & untracked file arguments
tracked_args=("${needed[@]/#/--track=}")
untracked_args=("${untracked[@]/#/--untrack=}")

# Track & untrack file arguments based on given data + ready conditions, display boot screen message & reboot. Also supports dracut.
if $applies_tracking || $applies_untracking || $applies_dracut; then
if $applies_tracking && ! $applies_untracking && ! $applies_dracut; then
printf "Found needed tracking initramfs changes, applying the following: %s\n" "${needed[*]}"
plymouth display-message --text="Updating initramfs - System will reboot" || true
rpm-ostree initramfs-etc "${tracked_args[@]}" --reboot
elif ! $applies_tracking && $applies_untracking && ! $applies_dracut; then
printf "Found needed removal of non-active tracked files, removing the following: %s\n" "${untracked[*]}"
plymouth display-message --text="Updating initramfs - System will reboot" || true
rpm-ostree initramfs-etc "${untracked_args[@]}" --reboot
elif $applies_tracking && $applies_untracking && ! $applies_dracut; then
printf "Found needed tracking initramfs changes, applying the following: %s\n" "${needed[*]}"
printf "Also applying needed removal of non-active tracked files: %s\n" "${untracked[*]}"
plymouth display-message --text="Updating initramfs - System will reboot" || true
rpm-ostree initramfs-etc "${tracked_args[@]}" "${untracked_args[@]}" --reboot
elif $applies_tracking && ! $applies_untracking && $applies_dracut; then
printf "Found needed tracking initramfs changes, applying the following: %s\n" "${needed[*]}"
echo "Also found dracut changes, so initramfs will be force rebuilt."
plymouth display-message --text="Updating initramfs with initramfs + dracut changes - System will reboot" || true
rpm-ostree initramfs-etc "${tracked_args[@]}" --force-sync --reboot
elif ! $applies_tracking && $applies_untracking && $applies_dracut; then
printf "Found needed removal of non-active tracked files, removing the following: %s\n" "${untracked[*]}"
echo "Also found dracut changes, so initramfs will be force rebuilt."
plymouth display-message --text="Updating initramfs with initramfs + dracut changes - System will reboot" || true
rpm-ostree initramfs-etc "${untracked_args[@]}" --force-sync --reboot
elif $applies_tracking && $applies_untracking && $applies_dracut; then
printf "Found needed tracking initramfs changes, applying the following: %s\n" "${needed[*]}"
printf "Also applying needed removal of non-active tracked files: %s\n" "${untracked[*]}"
echo "Also found dracut changes, so initramfs will be force rebuilt."
plymouth display-message --text="Updating initramfs with initramfs + dracut changes - System will reboot" || true
rpm-ostree initramfs-etc "${tracked_args[@]}" "${untracked_args[@]}" --force-sync --reboot
elif ! $applies_tracking && ! $applies_untracking && $applies_dracut; then
echo "Found needed dracut-only changes, force rebuilding initramfs & rebooting"
plymouth display-message --text="Updating initramfs with dracut changes only - System will reboot" || true
rpm-ostree initramfs-etc --force-sync --reboot
fi
else
echo "No initramfs & dracut changes detected"
fi
15 changes: 15 additions & 0 deletions config/files/usr/bin/minimum-free-zram
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

minimum_free_zram=$(awk '/MemTotal/ {printf "%.0f", $2 * 0.01}' /proc/meminfo)
current_free_zram=$(sysctl vm.min_free_kbytes | awk '{print $3}')

# Minimum-free ZRAM
printf "Current minimum-free ZRAM value: %s\n" "$current_free_zram"

if ((minimum_free_zram > current_free_zram)); then
sysctl -w "vm.min_free_kbytes=${minimum_free_zram}"
printf "Found needed minimum-free ZRAM changes, applying the following: %s\n" "$minimum_free_zram"
else
echo "No minimum-free ZRAM changes needed"
fi

Loading

0 comments on commit 9053187

Please sign in to comment.