Skip to content

Commit

Permalink
Merge pull request #5 from ublue-os/main
Browse files Browse the repository at this point in the history
  • Loading branch information
b- authored Oct 13, 2023
2 parents e1bddbb + 4e9fbae commit ff215d7
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 22 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ jobs:
else
echo "IMAGE_NAME=${{ format('{0}-{1}', matrix.base_name, matrix.image_flavor) }}" >> $GITHUB_ENV
fi
if [[ "${{ matrix.image_flavor }}" =~ "asus" ]]; then
echo "AKMODS_FLAVOR=asus" >> $GITHUB_ENV
elif [[ "${{ matrix.image_flavor }}" =~ "surface" ]]; then
echo "AKMODS_FLAVOR=surface" >> $GITHUB_ENV
else
echo "AKMODS_FLAVOR=main" >> $GITHUB_ENV
fi
- name: Generate tags
id: generate-tags
Expand Down Expand Up @@ -126,6 +133,7 @@ jobs:
IMAGE_FLAVOR=${{ matrix.image_flavor }}
FEDORA_MAJOR_VERSION=${{ matrix.major_version }}
TARGET_BASE=${{ matrix.target_base }}
AKMODS_FLAVOR=${{ env.AKMODS_FLAVOR }}
labels: ${{ steps.meta.outputs.labels }}
oci: false
# TODO(GH-280)
Expand Down
12 changes: 6 additions & 6 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-silverblue}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}"
ARG AKMODS_FLAVOR="${AKMODS_FLAVOR:-main}"
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-$BASE_IMAGE_NAME-$IMAGE_FLAVOR}"
ARG BASE_IMAGE="ghcr.io/ublue-os/${SOURCE_IMAGE}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}"
Expand All @@ -10,8 +11,9 @@ FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS bluefin

ARG IMAGE_NAME="${IMAGE_NAME}"
ARG IMAGE_VENDOR="ublue-os"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR}"
ARG AKMODS_FLAVOR="${AKMODS_FLAVOR}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
ARG PACKAGE_LIST="bluefin"

Expand All @@ -25,9 +27,8 @@ COPY image-info.sh /tmp/image-info.sh
COPY usr/etc/ublue-update/ublue-update.toml /tmp/ublue-update.toml

# Add ublue kmods, add needed negativo17 repo and then immediately disable due to incompatibility with RPMFusion
COPY --from=ghcr.io/ublue-os/akmods:main-${FEDORA_MAJOR_VERSION} /rpms /tmp/akmods-rpms
RUN if [[ "${IMAGE_FLAVOR}" = "main" || "${IMAGE_NAME}" = "nvidia" ]]; then \
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && \
COPY --from=ghcr.io/ublue-os/akmods:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION} /rpms /tmp/akmods-rpms
RUN sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && \
wget https://negativo17.org/repos/fedora-multimedia.repo -O /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \
if [[ "${FEDORA_MAJOR_VERSION}" -ge "39" ]]; then \
rpm-ostree install \
Expand All @@ -43,8 +44,7 @@ RUN if [[ "${IMAGE_FLAVOR}" = "main" || "${IMAGE_NAME}" = "nvidia" ]]; then \
; fi && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \
mkdir -p /etc/akmods-rpms/ && \
mv /tmp/akmods-rpms/kmods/*steamdeck*.rpm /etc/akmods-rpms/steamdeck.rpm \
; fi
mv /tmp/akmods-rpms/kmods/*steamdeck*.rpm /etc/akmods-rpms/steamdeck.rpm

# GNOME VRR
RUN wget https://copr.fedorainfracloud.org/coprs/kylegospo/gnome-vrr/repo/fedora-"${FEDORA_MAJOR_VERSION}"/kylegospo-gnome-vrr-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo && \
Expand Down
9 changes: 6 additions & 3 deletions just/custom.just
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ distrobox-universal:

# Switch to the fish shell
fish:
sudo lchsh $USER /usr/bin/fish
sudo usermod $USER --shell /usr/bin/fish
printf "${USER}'s shell is now %s." "$(cat /etc/passwd | grep ":$UID:" | cut '-d:' '-f7')"

# Install recommended GNOME extensions
gnome-extensions:
Expand Down Expand Up @@ -155,7 +156,8 @@ nix-devbox-global:
podmansh:
sudo mkdir -p /etc/containers/systemd/users/${UID}
sudo cp /usr/share/ublue-os/quadlets/podmansh.container /etc/containers/systemd/users/${UID}/podmansh.container
sudo lchsh $USER /usr/bin/podmansh
sudo usermod $USER --shell /usr/bin/podmansh
printf "${USER}'s shell is now %s." "$(cat /etc/passwd | grep ":$UID:" | cut '-d:' '-f7')"
podman pull ghcr.io/ublue-os/ubuntu-toolbox:latest

systemctl --user daemon-reload
Expand Down Expand Up @@ -215,7 +217,8 @@ yafti:

# Switch to the zsh shell
zsh:
sudo lchsh $USER /usr/bin/zsh
sudo usermod $USER --shell /usr/bin/zsh
printf "${USER}'s shell is now %s." "$(cat /etc/passwd | grep ":$UID:" | cut '-d:' '-f7')"

docker:
sudo systemctl enable --now docker
Expand Down
11 changes: 6 additions & 5 deletions usr/bin/ublue-system-flatpak-manager
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ if [[ -f $VER_FILE && $VER = $VER_RAN ]]; then
exit 0
fi

notify-send "Flatpak installer" "Currently installing system flatpaks" --app-name="Flatpak installer" -u NORMAL

# Remove fedora flatpak repo
if grep -qz 'fedora' <<< $(flatpak remotes); then
flatpak remote-delete --user fedora --force
Expand All @@ -27,13 +25,14 @@ REMOVE_LIST=$(cat /etc/flatpak/system/remove)
if [[ -n $INSTALL_LIST ]]; then
for flatpak in $INSTALL_LIST; do
if grep -qvz $flatpak <<< $FLATPAK_LIST; then
flatpak install --system --noninteractive flathub $flatpak
if ! flatpak install --system --noninteractive flathub $flatpak; then
# exit on error
exit 1
fi
fi
done
fi

notify-send "Flatpak installer" "Finished installing system flatpaks" --app-name="Flatpak installer" -u NORMAL

# Remove flatpaks in list
if [[ -n $REMOVE_LIST ]]; then
for flatpak in $REMOVE_LIST; do
Expand All @@ -58,5 +57,7 @@ fi
# Disable the system variant of the flathub repo
flatpak remote-modify flathub --disable --system

notify-send "Flatpak installer" "Finished installing system flatpaks" --app-name="Flatpak installer" -u NORMAL

mkdir -p /etc/ublue
echo $VER > $VER_FILE
12 changes: 6 additions & 6 deletions usr/bin/ublue-user-flatpak-manager
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,18 @@ FLATPAK_LIST=$(flatpak list --columns=application)
INSTALL_LIST=$(cat /etc/flatpak/user/install)
REMOVE_LIST=$(cat /etc/flatpak/user/remove)

notify-send "Flatpak installer" "Currently installing user flatpaks" --app-name="Flatpak installer" -u NORMAL

# Install flatpaks in list
if [[ -n $INSTALL_LIST ]]; then
for flatpak in $INSTALL_LIST; do
if grep -qvz $flatpak <<< $FLATPAK_LIST; then
flatpak install --user --noninteractive flathub $flatpak
if ! flatpak install --user --noninteractive flathub $flatpak; then
# exit on error
exit 1
fi
fi
done
fi

notify-send "Flatpak installer" "Finished installing user flatpaks" --app-name="Flatpak installer" -u NORMAL


# Remove flatpaks in list
if [[ -n $REMOVE_LIST ]]; then
for flatpak in $REMOVE_LIST; do
Expand All @@ -42,4 +40,6 @@ if [[ -n $REMOVE_LIST ]]; then
done
fi

notify-send "Flatpak installer" "Finished installing user flatpaks" --app-name="Flatpak installer" -u NORMAL

echo $VER > $VER_FILE
2 changes: 2 additions & 0 deletions usr/etc/flatpak/system/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.gnome.Cheese
org.gnome.eog
2 changes: 0 additions & 2 deletions usr/etc/flatpak/user/remove
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
org.gnome.Cheese
org.gnome.eog
2 changes: 2 additions & 0 deletions usr/lib/systemd/system/ublue-system-flatpak-manager.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ After=network-online.target ublue-system-setup.service
Type=oneshot
ExecStart=/usr/bin/ublue-system-flatpak-manager
Restart=on-failure
RestartSec=30
StartLimitInterval=0

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions usr/lib/systemd/user/ublue-user-flatpak-manager.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ After=network-online.target
Type=oneshot
ExecStart=/usr/bin/ublue-user-flatpak-manager
Restart=on-failure
RestartSec=30
StartLimitInterval=0

[Install]
WantedBy=default.target

0 comments on commit ff215d7

Please sign in to comment.