From 18d240cb4cbeb689b164f2bf462923bb400cea15 Mon Sep 17 00:00:00 2001 From: Eriq Taing Date: Mon, 30 Mar 2026 01:02:58 -0400 Subject: [PATCH] [hydros-systemd-units] Introduced package --- .../workflows/build-hydros-systemd-units.yml | 33 +++++++++++ .../hydros-systemd-units.spec | 55 +++++++++++++++++++ .../system/bootc-fetch-updates.service | 8 +++ .../systemd/system/bootc-fetch-updates.timer | 12 ++++ .../system/flatpak-system-update.service | 5 ++ .../system/flatpak-system-update.timer | 9 +++ .../systemd/user/flatpak-user-update.service | 5 ++ .../systemd/user/flatpak-user-update.timer | 9 +++ .../systemd/user/hyprlauncher.service | 18 ++++++ .../systemd/user/quickshell.service | 18 ++++++ .../systemd/user/ssh-agent.service | 10 ++++ 11 files changed, 182 insertions(+) create mode 100644 .gitea/workflows/build-hydros-systemd-units.yml create mode 100644 hydros-systemd-units/hydros-systemd-units.spec create mode 100644 hydros-systemd-units/systemd/system/bootc-fetch-updates.service create mode 100644 hydros-systemd-units/systemd/system/bootc-fetch-updates.timer create mode 100644 hydros-systemd-units/systemd/system/flatpak-system-update.service create mode 100644 hydros-systemd-units/systemd/system/flatpak-system-update.timer create mode 100644 hydros-systemd-units/systemd/user/flatpak-user-update.service create mode 100644 hydros-systemd-units/systemd/user/flatpak-user-update.timer create mode 100644 hydros-systemd-units/systemd/user/hyprlauncher.service create mode 100644 hydros-systemd-units/systemd/user/quickshell.service create mode 100644 hydros-systemd-units/systemd/user/ssh-agent.service diff --git a/.gitea/workflows/build-hydros-systemd-units.yml b/.gitea/workflows/build-hydros-systemd-units.yml new file mode 100644 index 0000000..8f27cfa --- /dev/null +++ b/.gitea/workflows/build-hydros-systemd-units.yml @@ -0,0 +1,33 @@ +name: Build hydros-systemd-units +on: + push: + branches: + - main + paths: + - .gitea/workflows/build-hydros-systemd-units.yml + - "hydros-systemd-units/**" + workflow_dispatch: + +jobs: + build_push: + name: Build and push image + runs-on: ubuntu-latest + + steps: + - name: Setup environment + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y podman iptables + + # These stage versions are pinned by https://github.com/renovatebot/renovate + - name: Checkout + uses: actions/checkout@v6 # v5 + + - name: Build RPM and Upload + uses: https://git.hydrosaber.com/hydros/build-rpm@main + with: + spec-file-path: ./hydros-systemd-units/hydros-systemd-units.spec + repository-user: eriq12 + repository-user-token: ${{ secrets.RPM_PACKAGE_TOKEN }} + extra-source-directory: ./hydros-systemd-units/systemd diff --git a/hydros-systemd-units/hydros-systemd-units.spec b/hydros-systemd-units/hydros-systemd-units.spec new file mode 100644 index 0000000..05740d3 --- /dev/null +++ b/hydros-systemd-units/hydros-systemd-units.spec @@ -0,0 +1,55 @@ +Name: hydros-systemd-units +Version: 0.0.1 +Release: %autorelease +Summary: The bundle of assets for HydrOS +BuildArch: noarch + +License: GPL +Source0: source.tar.gz + +%description + +%prep +%autosetup -C + +%install +install -Dm0644 -t %{buildroot}%{_unitdir}/ %{_builddir}/%{name}-%{version}/system/bootc-fetch-updates.service +install -Dm0644 -t %{buildroot}%{_unitdir}/ %{_builddir}/%{name}-%{version}/system/bootc-fetch-updates.timer +install -Dm0644 -t %{buildroot}%{_unitdir}/ %{_builddir}/%{name}-%{version}/system/flatpak-system-updates.service +install -Dm0644 -t %{buildroot}%{_unitdir}/ %{_builddir}/%{name}-%{version}/system/flatpak-system-update.timer +install -Dm0644 -t %{buildroot}%{_userunitdir}/ %{_builddir}/%{name}-%{version}/user/flatpak-user-update.service +install -Dm0644 -t %{buildroot}%{_userunitdir}/ %{_builddir}/%{name}-%{version}/user/flatpak-user-update.timer +install -Dm0644 -t %{buildroot}%{_userunitdir}/ %{_builddir}/%{name}-%{version}/user/hyprlaunhcer.service +install -Dm0644 -t %{buildroot}%{_userunitdir}/ %{_builddir}/%{name}-%{version}/user/quickshell.service +install -Dm0644 -t %{buildroot}%{_userunitdir}/ %{_builddir}/%{name}-%{version}/user/ssh-agent.service + +%post +%systemd_post bootc-fetch-updates.timer +%systemd_post flatpak-system-updates.timer +%systemd_user_post flatpak-user-updates.timer +%systemd_user_post hyprlauncher.timer +%systemd_user_post quickshell.service +%systemd_user_post ssh-agent.service + +%preun +%systemd_preun bootc-fetch-updates.timer +%systemd_preun flatpak-system-updates.timer +%systemd_user_preun flatpak-user-updates.timer +%systemd_user_preun hyprlauncher.timer +%systemd_user_preun quickshell.service +%systemd_user_preun ssh-agent.service + +%files +%{_unitdir}/bootc-fetch-updates.service +%{_unitdir}/bootc-fetch-updates.timer +%{_unitdir}/flatpak-system-update.service +%{_unitdir}/flatpak-system-update.timer +%{_userunitdir}/flatpak-user-update.service +%{_userunitdir}/flatpak-user-update.timer +%{_userunitdir}/hyprlauncher.service +%{_userunitdir}/quickshell.service +%{_userunitdir}/ssh-agent.service + +%changelog +* Mon Mar 30 2026 Eriq Taing +- First version packaged diff --git a/hydros-systemd-units/systemd/system/bootc-fetch-updates.service b/hydros-systemd-units/systemd/system/bootc-fetch-updates.service new file mode 100644 index 0000000..c316cde --- /dev/null +++ b/hydros-systemd-units/systemd/system/bootc-fetch-updates.service @@ -0,0 +1,8 @@ +[Unit] +Description=Download bootc updates +Documentation=man:bootc(8) +ConditionPathExists=/run/ostree-booted + +[Service] +Type=oneshot +ExecStart=/usr/bin/bootc update --quiet \ No newline at end of file diff --git a/hydros-systemd-units/systemd/system/bootc-fetch-updates.timer b/hydros-systemd-units/systemd/system/bootc-fetch-updates.timer new file mode 100644 index 0000000..482831f --- /dev/null +++ b/hydros-systemd-units/systemd/system/bootc-fetch-updates.timer @@ -0,0 +1,12 @@ +[Unit] +Description=Download bootc updates +Documentation=man:bootc(8) +ConditionPathExists=/run/ostree-booted + +[Timer] +OnBootSec=15min +OnUnitInactiveSec=8h +RandomizedDelaySec=2h + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/hydros-systemd-units/systemd/system/flatpak-system-update.service b/hydros-systemd-units/systemd/system/flatpak-system-update.service new file mode 100644 index 0000000..ca8f96c --- /dev/null +++ b/hydros-systemd-units/systemd/system/flatpak-system-update.service @@ -0,0 +1,5 @@ +[Unit] +Description=Update flatpaks + +[Service] +ExecStart=flatpak update --noninteractive \ No newline at end of file diff --git a/hydros-systemd-units/systemd/system/flatpak-system-update.timer b/hydros-systemd-units/systemd/system/flatpak-system-update.timer new file mode 100644 index 0000000..ff66905 --- /dev/null +++ b/hydros-systemd-units/systemd/system/flatpak-system-update.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Update flatpak + +[Timer] +OnBootSec=15min +OnCalendar=daily + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/hydros-systemd-units/systemd/user/flatpak-user-update.service b/hydros-systemd-units/systemd/user/flatpak-user-update.service new file mode 100644 index 0000000..ca8f96c --- /dev/null +++ b/hydros-systemd-units/systemd/user/flatpak-user-update.service @@ -0,0 +1,5 @@ +[Unit] +Description=Update flatpaks + +[Service] +ExecStart=flatpak update --noninteractive \ No newline at end of file diff --git a/hydros-systemd-units/systemd/user/flatpak-user-update.timer b/hydros-systemd-units/systemd/user/flatpak-user-update.timer new file mode 100644 index 0000000..ff66905 --- /dev/null +++ b/hydros-systemd-units/systemd/user/flatpak-user-update.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Update flatpak + +[Timer] +OnBootSec=15min +OnCalendar=daily + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/hydros-systemd-units/systemd/user/hyprlauncher.service b/hydros-systemd-units/systemd/user/hyprlauncher.service new file mode 100644 index 0000000..fc84c49 --- /dev/null +++ b/hydros-systemd-units/systemd/user/hyprlauncher.service @@ -0,0 +1,18 @@ +[Unit] +Description=A launcher for the hypr ecosystem +# order startup after WM +After=graphical-session.target + +[Service] +Type=exec +# Repurpose XDG Autostart filtering +ExecCondition=/lib/systemd/systemd-xdg-autostart-condition "wlroots:sway:Wayfire:labwc:Hyprland" "" +ExecStart=/usr/bin/hyprlauncher -d +Restart=on-failure +Slice=app-graphical.slice + +[Install] +WantedBy=graphical-session.target +# Alternatively can be wanted by specific WMs' targets +# Should also be duplicated in 'After=' to avoid ordering loop +#WantedBy=wayland-session@hyprland.desktop.target diff --git a/hydros-systemd-units/systemd/user/quickshell.service b/hydros-systemd-units/systemd/user/quickshell.service new file mode 100644 index 0000000..58bb2e0 --- /dev/null +++ b/hydros-systemd-units/systemd/user/quickshell.service @@ -0,0 +1,18 @@ +[Unit] +Description=A shell developed by outfoxxed +# order startup after WM +After=graphical-session.target + +[Service] +Type=exec +# Repurpose XDG Autostart filtering +ExecCondition=/lib/systemd/systemd-xdg-autostart-condition "wlroots:sway:Wayfire:labwc:Hyprland" "" +ExecStart=/usr/bin/quickshell +Restart=on-failure +Slice=app-graphical.slice + +[Install] +WantedBy=graphical-session.target +# Alternatively can be wanted by specific WMs' targets +# Should also be duplicated in 'After=' to avoid ordering loop +#WantedBy=wayland-session@hyprland.desktop.target diff --git a/hydros-systemd-units/systemd/user/ssh-agent.service b/hydros-systemd-units/systemd/user/ssh-agent.service new file mode 100644 index 0000000..9428410 --- /dev/null +++ b/hydros-systemd-units/systemd/user/ssh-agent.service @@ -0,0 +1,10 @@ +[Unit] +Description=SSH key agent + +[Service] +Type=simple +Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket +ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK + +[Install] +WantedBy=default.target