From 44e2533c2256b11bc59f4b93adaf4d2a7ef7c070 Mon Sep 17 00:00:00 2001 From: Jakub Turski Date: Thu, 28 Nov 2024 15:04:03 +0000 Subject: [PATCH] build: carve out common recipe bits --- files/scripts/os-release-yaucore.sh | 6 +++ .../{os-release.sh => os-release-yaurora.sh} | 0 recipes/base/chezmoi.yaml | 5 ++ recipes/base/files.yaml | 5 ++ recipes/base/rpm-ostree.yaml | 31 ++++++++++++ recipes/base/script.yaml | 4 ++ recipes/yaucore.yaml | 50 ++----------------- recipes/yaurora.yaml | 50 +++---------------- 8 files changed, 64 insertions(+), 87 deletions(-) create mode 100644 files/scripts/os-release-yaucore.sh rename files/scripts/{os-release.sh => os-release-yaurora.sh} (100%) create mode 100644 recipes/base/chezmoi.yaml create mode 100644 recipes/base/files.yaml create mode 100644 recipes/base/rpm-ostree.yaml create mode 100644 recipes/base/script.yaml diff --git a/files/scripts/os-release-yaucore.sh b/files/scripts/os-release-yaucore.sh new file mode 100644 index 0000000..1210eaa --- /dev/null +++ b/files/scripts/os-release-yaucore.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail + +sed -i ' +/^PRETTY_NAME=/s/uCore/yaucore/ +' /usr/lib/os-release diff --git a/files/scripts/os-release.sh b/files/scripts/os-release-yaurora.sh similarity index 100% rename from files/scripts/os-release.sh rename to files/scripts/os-release-yaurora.sh diff --git a/recipes/base/chezmoi.yaml b/recipes/base/chezmoi.yaml new file mode 100644 index 0000000..097a5f6 --- /dev/null +++ b/recipes/base/chezmoi.yaml @@ -0,0 +1,5 @@ +# set up chezmoi +type: chezmoi +repository: https://github.com/yacoob/dotfiles +all-users: true +file-conflict-policy: skip diff --git a/recipes/base/files.yaml b/recipes/base/files.yaml new file mode 100644 index 0000000..99e0ab3 --- /dev/null +++ b/recipes/base/files.yaml @@ -0,0 +1,5 @@ +# copy contents of files/system/* directly to the target +type: files +files: + - source: system + destination: / diff --git a/recipes/base/rpm-ostree.yaml b/recipes/base/rpm-ostree.yaml new file mode 100644 index 0000000..c1d7d04 --- /dev/null +++ b/recipes/base/rpm-ostree.yaml @@ -0,0 +1,31 @@ +# add repositories, install RPM packages +type: rpm-ostree +repos: + - https://copr.fedorainfracloud.org/coprs/atim/bottom/repo/fedora-%OS_VERSION%/atim-bottom-fedora-%OS_VERSION%.repo + - https://copr.fedorainfracloud.org/coprs/atim/lazygit/repo/fedora-%OS_VERSION%/atim-lazygit-fedora-%OS_VERSION%.repo + - https://copr.fedorainfracloud.org/coprs/faramirza/gdu/repo/fedora-%OS_VERSION%/faramirza-gdu-fedora-%OS_VERSION%.repo + - https://repository.mullvad.net/rpm/stable/mullvad.repo +install: + - autorestic + - bat + - difftastic + - direnv + - fd-find + - gh + - git-lfs + - lnav + - ltrace + - neovim + - ripgrep + - strace + - syncthing + - tealdeer + - ugrep + - yq + # third party pkgs + - bottom + - gdu + - lazygit + - mullvad-vpn +optfix: + - Mullvad VPN diff --git a/recipes/base/script.yaml b/recipes/base/script.yaml new file mode 100644 index 0000000..c05e8b4 --- /dev/null +++ b/recipes/base/script.yaml @@ -0,0 +1,4 @@ +# run shell scripts +type: script +scripts: + - eget.sh diff --git a/recipes/yaucore.yaml b/recipes/yaucore.yaml index 0fca84f..f46f937 100644 --- a/recipes/yaucore.yaml +++ b/recipes/yaucore.yaml @@ -7,55 +7,15 @@ image-version: stable # NOTE: the order of the modules in this file translates to the order of RUN lines in generated Containerfile. # Which means, keep the least often modified modules at the top, so the whole thing caches better. modules: - # set up chezmoi - - type: chezmoi - repository: https://github.com/yacoob/dotfiles - all-users: true - file-conflict-policy: skip - - # copy contents of files/system/* directly to the target - - type: files - files: - - source: system - destination: / + - from-file: base/chezmoi.yaml + - from-file: base/files.yaml + - from-file: base/script.yaml + - from-file: base/rpm-ostree.yaml # run shell scripts - type: script scripts: - - eget.sh - - # add repositories, install RPM packages - - type: rpm-ostree - repos: - - https://copr.fedorainfracloud.org/coprs/atim/bottom/repo/fedora-%OS_VERSION%/atim-bottom-fedora-%OS_VERSION%.repo - - https://copr.fedorainfracloud.org/coprs/atim/lazygit/repo/fedora-%OS_VERSION%/atim-lazygit-fedora-%OS_VERSION%.repo - - https://copr.fedorainfracloud.org/coprs/faramirza/gdu/repo/fedora-%OS_VERSION%/faramirza-gdu-fedora-%OS_VERSION%.repo - - https://repository.mullvad.net/rpm/stable/mullvad.repo - install: - - ansible - - autorestic - - bat - - difftastic - - direnv - - fd-find - - gh - - git-lfs - - lnav - - ltrace - - neovim - - ripgrep - - strace - - syncthing - - tealdeer - - ugrep - - yq - # third party pkgs - - bottom - - gdu - - lazygit - - mullvad-vpn - optfix: - - Mullvad VPN + - os-release-yaucore.sh # sign the image - type: signing diff --git a/recipes/yaurora.yaml b/recipes/yaurora.yaml index fc5dccf..4adc76c 100644 --- a/recipes/yaurora.yaml +++ b/recipes/yaurora.yaml @@ -7,17 +7,15 @@ image-version: stable # NOTE: the order of the modules in this file translates to the order of RUN lines in generated Containerfile. # Which means, keep the least often modified modules at the top, so the whole thing caches better. modules: - # set up chezmoi - - type: chezmoi - repository: https://github.com/yacoob/dotfiles - all-users: true - file-conflict-policy: skip + - from-file: base/chezmoi.yaml + - from-file: base/files.yaml + - from-file: base/script.yaml + - from-file: base/rpm-ostree.yaml - # copy contents of files/system/* directly to the target - - type: files - files: - - source: system - destination: / + # run shell scripts + - type: script + scripts: + - os-release-yaurora.sh # install flatpaks - type: default-flatpaks @@ -41,49 +39,17 @@ modules: - org.kde.kcalc - org.mozilla.Thunderbird - # run shell scripts - - type: script - scripts: - - eget.sh - - os-release.sh - # add repositories, install RPM packages - type: rpm-ostree repos: - - https://copr.fedorainfracloud.org/coprs/atim/bottom/repo/fedora-%OS_VERSION%/atim-bottom-fedora-%OS_VERSION%.repo - - https://copr.fedorainfracloud.org/coprs/atim/lazygit/repo/fedora-%OS_VERSION%/atim-lazygit-fedora-%OS_VERSION%.repo - - https://copr.fedorainfracloud.org/coprs/faramirza/gdu/repo/fedora-%OS_VERSION%/faramirza-gdu-fedora-%OS_VERSION%.repo - https://copr.fedorainfracloud.org/coprs/mdwalters/neovide/repo/fedora-%OS_VERSION%/mdwalters-neovide-fedora-%OS_VERSION%.repo - - https://repository.mullvad.net/rpm/stable/mullvad.repo install: - - autorestic - - bat - - difftastic - - direnv - fcitx5 - fcitx5-mozc - - fd-find - - gh - - git-lfs - kcm-fcitx5 - - lnav - - ltrace - - neovim - - ripgrep - - strace - - syncthing - - tealdeer - trash-cli - - ugrep - - yq # third party pkgs - - bottom - - gdu - - lazygit - - mullvad-vpn - neovide - optfix: - - Mullvad VPN # sign the image - type: signing