Skip to content

Commit

Permalink
feature: create cosmic dekstop base image
Browse files Browse the repository at this point in the history
  • Loading branch information
p5 committed Jul 22, 2024
1 parent 4cdf0fe commit 15e174d
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @p5
23 changes: 23 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",

// Use the basic Renovate preset, and allow settings to be overridden
"extends": [
"config:best-practices"
],

"packageRules": [
{
// Automatically update any GitHub Actions packages through minor and patch upgrades
"automerge": true,
"matchUpdateTypes": ["minor", "patch", "pin", "digest", "pinDigest"],
"matchManagers": [
"github-actions"
]
}
],

"dockerfile": {
"enabled": false
}
}
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Images

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "0 */12 * * *"
workflow_dispatch:

env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fedora-version: [40]
desktop-environment: [cosmic]
permissions:
contents: read
packages: write
id-token: write
env:
IMAGE_NAME: eternal-linux/base/${{ matrix.desktop-environment }}
FEDORA_VERSION: ${{ matrix.fedora-version }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Generate Image Tags
uses: rsturla/eternal-main/.github/actions/generate-image-tags
with:
image-name: ${{ env.IMAGE_REGISTRY}}/${{ env.IMAGE_NAME }}
major-version: ${{ env.FEDORA_VERSION }}
is-release: ${{ github.event_name != 'pull_request' }}

- name: Build Image
uses: rsturla/eternal-main/.github/actions/build-image
with:
builder: docker
context: ./desktop-environments/${{ matrix.desktop-environment }}
image-name: ${{ env.IMAGE_NAME }}
image-tag: |
${{ steps.generate-image-tags.outputs.tags }}
build-args: |
FEDORA_VERSION=${{ env.FEDORA_VERSION }}
- name: Push Image
uses: rsturla/eternal-main/.github/actions/push-image
with:
builder: ${{ steps.build-image.outputs.builder }}
image-name: ${{ steps.build.outputs.image }}
image-tags: ${{ steps.build.outputs.tags }}
image-registry: ${{ env.IMAGE_REGISTRY }}
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Renovate CI

on:
pull_request:
paths:
- ".github/renovate.json5"
- ".github/workflows/renovate.yml"
push:
branches:
- main
paths:
- ".github/renovate.json5"
- ".github/workflows/renovate.yml"

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Validate Renovate Configuration
uses: ./.github/actions/validate-renovate-config
20 changes: 20 additions & 0 deletions desktop-environments/cosmic/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG FEDORA_VERSION=40
ARG FEDORA_EDITION=base
ARG FEDORA_IMAGE=quay.io/fedora-ostree-desktops/${FEDORA_EDITION}:${FEDORA_VERSION}

FROM ${FEDORA_IMAGE}

COPY files/ /

RUN rpm-ostree install \
cosmic-desktop \
gnome-keyring

RUN rm -f /etc/systemd/system/display-manager.service && \
ln -s /usr/lib/systemd/system/cosmic-greeter.service /etc/systemd/system/display-manager.service \
&& \
systemctl enable greetd-workaround.service \
&& \
rpm-ostree cleanup -m && \
rm -rf /tmp/* /var/* && \
ostree container commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[copr:copr.fedorainfracloud.org:ryanabx:cosmic-epoch]
name=Copr repo for cosmic-epoch owned by ryanabx
baseurl=https://download.copr.fedorainfracloud.org/results/ryanabx/cosmic-epoch/fedora-$releasever-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://download.copr.fedorainfracloud.org/results/ryanabx/cosmic-epoch/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Unit]
Description=Workaround for SELinux issues for greetd
ConditionFileIsExecutable=/usr/bin/greetd
After=local-fs.target

[Service]
Type=oneshot
# Copy if it doesn't exist
ExecStartPre=/usr/bin/mkdir -p /usr/local/bin/overrides
ExecStartPre=/usr/bin/bash -c "[ -x /usr/local/bin/overrides/greetd ] || /usr/bin/cp /usr/bin/greetd /usr/local/bin/overrides/greetd"
# This is faster than using .mount unit. Also allows for the previous line/cleanup
ExecStartPre=/usr/bin/bash -c "/usr/bin/mount --bind /usr/local/bin/overrides/greetd /usr/bin/greetd"
# Fix caps
ExecStart=/usr/bin/bash -c "/usr/sbin/restorecon -rv /usr/bin/greetd"
# Clean-up after ourselves
ExecStop=/usr/bin/umount /usr/bin/greetd
ExecStop=/usr/bin/rm /usr/local/bin/overrides/greetd
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

0 comments on commit 15e174d

Please sign in to comment.