Move from config/ to files/

This commit is contained in:
Gerald Pinder
2024-07-23 12:10:08 -04:00
parent d059d23860
commit 01fd577dc5
37 changed files with 12 additions and 6 deletions

5
files/README.md Normal file
View File

@@ -0,0 +1,5 @@
- `desktop-audio` - Contains JACK fixes to allow using headphones and speakers at the same time
- `distrobox` - Declaritive files for distrobox images
- `pipewire-tweaks` - Tweaks to pipewire to increase performance ([docs](https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Performance-tuning))
- `steam-firewall` - Firewall settings for steam to open the port for P2P downloads
- `yafti` - Yafti launcher configurations

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -0,0 +1,3 @@
# This file was added by the program 'hda-jack-retask'.
# If you want to revert the changes made by this program, you can simply erase this file and reboot your computer.
options snd-hda-intel patch=hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw

View File

@@ -0,0 +1,14 @@
[codec]
0x10ec0b00 0x10438797 0
[pincfg]
0x11 0x411111f0
0x14 0x01014010
0x15 0x01011012
0x16 0x01016011
0x17 0x40170000
0x18 0x01a19050
0x19 0x02a19060
0x1a 0x0181305f
0x1b 0x01014010
0x1e 0x01456140

View File

@@ -0,0 +1,15 @@
[ubuntu]
image=ghcr.io/ublue-os/ubuntu-toolbox:latest
init=false
nvidia=false
pull=true
root=false
replace=true
[fedora]
image=registry.fedoraproject.org/fedora-toolbox:latest
init=false
nvidia=false
pull=true
root=false
replace=true

View File

@@ -0,0 +1,4 @@
# Default limits for users of pipewire
@pipewire - rtprio 95
@pipewire - nice -19
@pipewire - memlock 4194304

View File

@@ -0,0 +1,13 @@
RTKIT_ARGS="--scheduling-policy=FIFO
--our-realtime-priority=89
--max-realtime-priority=88
--min-nice-level=-19
--rttime-usec-max=2000000
--users-max=100
--processes-per-user-max=1000
--threads-per-user-max=10000
--actions-burst-sec=10
--actions-per-burst-max=1000
--canary-cheep-msec=30000
--canary-watchdog-msec=60000
"

View File

@@ -0,0 +1,4 @@
[Service]
EnvironmentFile=/etc/sysconfig/rtkit
ExecStart=
ExecStart=/usr/libexec/rtkit-daemon $RTKIT_ARGS

View File

@@ -0,0 +1,7 @@
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# For option meanings, see rpm-ostreed.conf(5).
[Daemon]
AutomaticUpdatePolicy=stage
#IdleExitTimeout=60

55
files/scripts/README.md Normal file
View File

@@ -0,0 +1,55 @@
# Custom scripts
You can add custom scripts to this directory and declare them to be run at build time in the `scripts:` section of `recipe.yml`. Custom scripts can be run at either the `pre:` execution phase right after the custom repositories are added, or at the `post:` phase after all of the automatic build steps.
Your scripts will be given exactly one argument when they are executed, which specifies its precise execution phase (`pre` or `post`). The primary purpose of this argument is to streamline the reuse of scripts for multiple stages. This argument is provided for both manually declared scripts and scripts ran by `autorun.sh`.
## Creating a script
Look at `example.sh` for an example shell script. You can rename and copy the file for your own purposes. In order for the script to be executed, either move it to `scripts/pre/` or `scripts/post/` (if using `autorun.sh`) or declare it in the `recipe.yml`.
All commands from RPMs you've declared in the `recipe.yml` should be available when running scripts at the `post` execution phase.
When creating a script, please make sure
- ...its filename ends with `.sh`.
- This follows convention for (especially bash) shell scripts.
- `autorun.sh` only executes files that match `*.sh`.
- ...it starts with a [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) like `#!/usr/bin/env bash`.
- This ensures the script is ran with the correct interpreter / shell.
- ...it contains the command `set -oue pipefail` near the start.
- This will make the image build fail if your script fails. If you do not care if your script works or not, you can omit this line.
## `autorun.sh`
`autorun.sh` is a script that automatically runs all scripts in the folders `scripts/pre/` and `scripts/post/` at the correct execution phases. It is enabled by default, but you can disable it by removing it from `recipe.yml`. Manually listed scripts can be combined with `autorun.sh`.
There are a few rules, which aim to simplify your script management:
- `autorun.sh` will only execute scripts at the FIRST level within the directory, which
means that anything stored in e.g. `scripts/pre/deeperfolder/` will NOT execute.
This is intentional, so that you can store libraries and helper scripts
within subdirectories.
- You script directories and the scripts within them can be symlinks, to allow
easy reuse of scripts. For example, if you want the same scripts to execute
during both the `pre` and `post` stages, you could simply symlink individual
scripts or the entire `pre` and `post` directories to each other. However,
remember to only use RELATIVE symlinks, to ensure that the links work
properly. For example, `ln -s ../pre/foo.sh scripts/post/foo.sh`.
- All scripts execute in a numerically and alphabetically sorted order, which
allows you to easily control the execution order of your scripts. If it's
important that they execute in a specific order, then you should give them
appropriate names. For example, `05-foo.s` would always execute before
another script named `99-bar.sh`. It's recommended to use zero-padded,
numerical prefixes when you want to specify the execution order.
- The manually listed scripts in `recipe.yml` should
be stored directly within `scripts/`, or in a custom subdirectory that
doesn't match any of the execution phases. For example, you could
set the `pre:` section of `recipe.yml` to execute both `autorun.sh`
and `fizzwidget/something.sh`, and then place a bunch of auto-executed
scripts under `scripts/pre/` for the autorunner. This makes it very simple
to reuse common scripts between multiple different `recipe.yml` files,
while also having some scripts be specific to different `recipe.yml`s.
- You can safely specify `autorun.sh` as a script in `recipe.yml`,
even if the special directories don't exist or don't contain any
scripts. It will gracefully skip the processing if there's nothing to do.

View File

@@ -0,0 +1,4 @@
#/usr/bin/env bash
set -euo pipefail
systemctl enable crond

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
# Only install cliwrap if it's not already installed
# Usually needed when doing kernel-related changes with classic Fedora tools
# so those tools are aware of ostree nature of Fedora Atomic & adapt to it
# https://coreos.github.io/rpm-ostree/cliwrap/
if [[ ! -f "/usr/libexec/rpm-ostree/wrapped/dracut" ]]; then
echo "Installing cliwrap"
rpm-ostree cliwrap install-to-root /
else
echo "Cliwrap is already installed"
fi
QUALIFIED_KERNEL="$(rpm -qa | grep -P 'kernel-(\d+\.\d+\.\d+)' | sed -E 's/kernel-//')"
/usr/libexec/rpm-ostree/wrapped/dracut --no-hostonly --kver "${QUALIFIED_KERNEL}" --reproducible -v --add ostree -f "/lib/modules/${QUALIFIED_KERNEL}/initramfs.img"
chmod 0600 "/lib/modules/${QUALIFIED_KERNEL}/initramfs.img"

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
cd /usr/bin/
curl -L "https://github.com/vadimcn/vscode-lldb/releases/download/v1.7.0/codelldb-x86_64-linux.vsix" -o "codelldb-x86_64-linux.zip"
unzip "codelldb-x86_64-linux.zip" "extension/adapter/*" "extension/lldb/*" > /dev/null
rm -f "codelldb-x86_64-linux.zip"
mv extension/ codelldb_adapter
ln -s $(pwd)/codelldb_adapter/adapter/codelldb /usr/bin/codelldb
codelldb -h > /dev/null

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
VERSION=v0.7.23
wget -q https://github.com/earthly/earthly/releases/download/$VERSION/earthly-linux-amd64 -O /usr/bin/earthly
chmod +x /usr/bin/earthly

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -ueo pipefail
git clone https://github.com/KyleGospo/gamescope-session.git /tmp/gamescope-session
cd /tmp/gamescope-session
cp -rf usr/* /usr
[ -f /usr/share/gamescope-session-plus/gamescope-session-plus ]

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
apt-get update && apt-get install -y git
mkdir -p /src/
cd /src/
git clone https://github.com/helix-editor/helix.git
cd helix
RUSTFLAGS="-C target-feature=-crt-static"
cargo install --path helix-term
mkdir -p /out/
mv $CARGO_HOME/bin/hx /out/hx
mv runtime /out/

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -eou pipefail
# Version number
VERSION="2023.1.2"
# Download https://download.jetbrains.com/idea/ideaIC-${VERSION}.tar.gz
curl -L -o /tmp/ideaIC-${VERSION}.tar.gz https://download.jetbrains.com/idea/ideaIC-${VERSION}.tar.gz
# Extract to /usr/opt
mkdir -p /usr/opt
tar -xzf /tmp/ideaIC-${VERSION}.tar.gz -C /usr/opt
# Find the full path to the IntelliJ directory
IDEA_PATH=$(ls -d /usr/opt/idea-IC-*)
# Create .desktop file
cat > /tmp/intellij.desktop <<EOL
[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA Community Edition
Icon=$IDEA_PATH/bin/idea.png
Exec="$IDEA_PATH/bin/idea.sh" %f
Terminal=false
Categories=Development;IDE;
EOL
# Make the application available to all users
sudo mv /tmp/intellij.desktop /usr/share/applications/

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
cp mkcert-v*-linux-amd64 /usr/bin/mkcert

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -oue pipefail
rpm -i https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-fedora-repo-2-1.noarch.rpm

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -eou pipefail
# Version number
VERSION="2023.1.2"
# Download https://download.jetbrains.com/ruby/RubyMine-2023.1.2.tar.gz
curl -L -o /tmp/RubyMine-${VERSION}.tar.gz https://download.jetbrains.com/ruby/RubyMine-${VERSION}.tar.gz
# Extract to /usr/opt
mkdir -p /usr/opt
tar -xzf /tmp/RubyMine-${VERSION}.tar.gz -C /usr/opt
# Find the full path to the RubyMine directory
RUBYMINE_PATH=$(ls -d /usr/opt/RubyMine-*)
# Create .desktop file
cat > /tmp/rubymine.desktop <<EOL
[Desktop Entry]
Version=1.0
Type=Application
Name=RubyMine
Icon=$RUBYMINE_PATH/bin/rubymine.png
Exec="$RUBYMINE_PATH/bin/rubymine.sh" %f
Terminal=false
Categories=Development;IDE;
EOL
# Make the application available to all users
sudo mv /tmp/rubymine.desktop /usr/share/applications/

View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -oue pipefail
VERSION="v1.27.1"
BASE_URL="https://github.com/syncthing/syncthing/releases/download"
FILENAME="syncthing-linux-amd64-${VERSION}.tar.gz"
EXTRACTED_DIR="syncthing-linux-amd64-${VERSION}"
# Download the file
wget --quiet "${BASE_URL}/${VERSION}/${FILENAME}"
# Extract the file
tar xf "${FILENAME}"
# Move the binary to /usr/local/bin
mv "${EXTRACTED_DIR}/syncthing" /usr/bin
# Move .desktop files
mv "${EXTRACTED_DIR}/etc/linux-desktop/"*.desktop /usr/share/applications/
# Move the systemd service file
cp "${EXTRACTED_DIR}/etc/linux-systemd/user/syncthing.service" /etc/systemd/system/
# Enable the systemd service
systemctl enable syncthing
# Verify the installation
if command -v syncthing &> /dev/null
then
echo "Syncthing command is found in PATH."
else
echo "Syncthing command not found in PATH."
exit 1
fi
# Verify that syncthing --version works
if syncthing --version &> /dev/null
then
echo "Syncthing --version executes successfully."
else
echo "Syncthing --version did not execute successfully."
exit 1
fi
# Cleanup
rm -rf "${EXTRACTED_DIR}"

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -oue pipefail
cat <<EOF | tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key
EOF

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
# Download udev rules file
wget https://openrgb.org/releases/release_0.9/60-openrgb.rules -O /tmp/60-openrgb.rules
# Move udev rules file to udev rules directory
mv /tmp/60-openrgb.rules /usr/lib/udev/rules.d

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# https://docs.gitlab.com/runner/install/docker.html#selinux
set -euo pipefail
git clone https://github.com/dpw/selinux-dockersock.git /tmp/selinux-dockersock
pushd /tmp/selinux-dockersock
make dockersock.pp
semodule -i dockersock.pp
popd

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -oue pipefail
rpm --import https://packages.microsoft.com/keys/microsoft.asc
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'

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>steam-local-transfer</short>
<description>Steam local transfer</description>
<port protocol="tcp" port="57343"/>
<port protocol="tcp" port="27040"/>
</service>

View File

@@ -0,0 +1,9 @@
[Desktop Entry]
Name=uBlue First Boot Setup
Comment=Sets up the uBlue desktop on first boot.
GenericName=Launcher
Categories=Utility;System;
Exec=/usr/share/ublue-os/firstboot/launcher/autostart.sh
Icon=application-x-executable
Terminal=false
Type=Application

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Simply launches the "yafti" GUI with the uBlue image's configuration.
/usr/bin/yafti /usr/share/ublue-os/firstboot/yafti.yml

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -0,0 +1,15 @@
# Only process users with home directories, but skip the "root" user.
if [ "$(id -u)" != "0" ] && [ ! -z "$HOME" ] && [ -d "$HOME" ]; then
# Ensure target file exists and is a symlink (not a regular file or dir).
if [ ! -L "$HOME"/.config/autostart/ublue-firstboot.desktop ]; then
# Remove any leftovers or incorrect (non-link) files with the same name.
rm -rf "$HOME"/.config/autostart/ublue-firstboot.desktop
# Create symlink to uBlue's autostart runner.
# Note that "broken autostart symlinks" are harmless if they remain
# after distro switching, and just cause a minor syslog warning. The
# user can manually delete this file if they migrate away from uBlue.
mkdir -p "$HOME"/.config/autostart
ln -s "/usr/share/ublue-os/firstboot/launcher/autostart.desktop" "$HOME"/.config/autostart/ublue-firstboot.desktop
fi
fi

View File

@@ -0,0 +1,141 @@
title: Welcome to Wunker OS!
properties:
mode: "run-on-change"
screens:
first-screen:
source: yafti.screen.title
values:
title: "Welcome to Wunker OS!"
icon: "/path/to/icon"
description: |
This guided installer will help you get started with your new system.
can-we-modify-your-flatpaks:
source: yafti.screen.consent
values:
title: Welcome, Traveler!
condition:
run: flatpak remotes --columns=name | grep fedora
description: |
We have detected the limited, Fedora-provided Flatpak remote on your system, whose applications are usually missing important codecs and other features. This step will therefore remove all basic Fedora Flatpaks from your system! We will instead switch all core Flatpak applications over to the vastly superior, unfiltered Flathub. If you don't want to do this, simply exit this installer.
actions:
- run: flatpak remote-delete --system --force fedora
- run: flatpak remote-delete --user --force fedora
- run: flatpak remove --system --noninteractive --all
- run: flatpak remote-add --if-not-exists --system flathub https://flathub.org/repo/flathub.flatpakrepo
- run: flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
check-system-flathub:
source: yafti.screen.consent
values:
title: Missing Flathub Repository (System)
condition:
run: flatpak remotes --system --columns=name | grep flathub | wc -l | grep '^0$'
description: |
We have detected that you don't have Flathub's repository on your system. We will now add that repository to your system-wide list.
actions:
- run: flatpak remote-add --if-not-exists --system flathub https://flathub.org/repo/flathub.flatpakrepo
check-user-flathub:
source: yafti.screen.consent
values:
title: Missing Flathub Repository (User)
condition:
run: flatpak remotes --user --columns=name | grep flathub | wc -l | grep '^0$'
description: |
We have detected that you don't have Flathub's repository on your current user account. We will now add that repository to your account.
actions:
- run: flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
applications:
source: yafti.screen.package
values:
title: Application Installer
show_terminal: true
package_manager: yafti.plugin.flatpak
package_manager_defaults:
user: true
system: false
groups:
Core GNOME Apps:
description: Core system applications for the GNOME desktop environment.
default: true
packages:
- Calculator: org.gnome.Calculator
- Calendar: org.gnome.Calendar
- Characters: org.gnome.Characters
- Cheese: org.gnome.Cheese
- Clocks: org.gnome.clocks
- Connections: org.gnome.Connections
- Contacts: org.gnome.Contacts
- Disk Usage Analyzer: org.gnome.baobab
- Document Scanner: org.gnome.SimpleScan
- Document Viewer: org.gnome.Evince
- Extension Manager: com.mattjakeman.ExtensionManager
- Font Viewer: org.gnome.font-viewer
- Image Viewer: org.gnome.eog
- Logs: org.gnome.Logs
- Maps: org.gnome.Maps
- Photos (Organizer): org.gnome.Photos
- Sushi (Nautilus Previewer): org.gnome.NautilusPreviewer
- Text Editor: org.gnome.TextEditor
- Videos (Player): org.gnome.Totem
- Weather: org.gnome.Weather
System Apps:
description: System applications for all desktop environments.
default: false
packages:
- Deja Dup Backups: org.gnome.DejaDup
- Fedora Media Writer: org.fedoraproject.MediaWriter
- Flatseal (Permission Manager): com.github.tchx84.Flatseal
- Font Downloader: org.gustavoperedo.FontDownloader
- Mozilla Firefox: org.mozilla.firefox
Web Browsers:
description: Additional browsers to complement or replace Firefox.
default: false
packages:
- Brave: com.brave.Browser
- Google Chrome: com.google.Chrome
- Microsoft Edge: com.microsoft.Edge
- Opera: com.opera.Opera
Gaming:
description: "Rock and Stone!"
default: false
packages:
- Bottles: com.usebottles.bottles
- Discord: com.discordapp.Discord
- GNOME Games: org.gnome.Games
- Heroic Games Launcher: com.heroicgameslauncher.hgl
- Steam: com.valvesoftware.Steam
- Gamescope (Utility): com.valvesoftware.Steam.Utility.gamescope
- MangoHUD (Utility): org.freedesktop.Platform.VulkanLayer.MangoHud//22.08
- SteamTinkerLaunch (Utility): com.valvesoftware.Steam.Utility.steamtinkerlaunch
- Proton Updater for Steam: net.davidotek.pupgui2
Office:
description: Boost your productivity.
default: false
packages:
- LibreOffice: org.libreoffice.LibreOffice
- OnlyOffice: org.onlyoffice.desktopeditors
- Obsidian: md.obsidian.Obsidian
- Slack: com.slack.Slack
- Standard Notes: org.standardnotes.standardnotes
- Thunderbird Email: org.mozilla.Thunderbird
Streaming:
description: Stream to the Internet.
default: false
packages:
- OBS Studio: com.obsproject.Studio
- VkCapture for OBS: com.obsproject.Studio.OBSVkCapture
- Gstreamer for OBS: com.obsproject.Studio.Plugin.Gstreamer
- Gstreamer VAAPI for OBS: com.obsproject.Studio.Plugin.GStreamerVaapi
- Boatswain for Streamdeck: com.feaneron.Boatswain
final-screen:
source: yafti.screen.title
values:
title: "All done!"
icon: "/path/to/icon"
# links:
# - "Website":
# run: /usr/bin/xdg-open https://ublue.it
# - "Join the Discord Community":
# run: /usr/bin/xdg-open https://discord.gg/XjG48C7VHx
description: |
Thanks for using Wunker OS, we hope you enjoy it!