From 7581863a4f8fd7f54464253d0a106431cab7af9d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 17 Mar 2022 17:38:44 +0800 Subject: [PATCH] Modularize tasks into roles Now, it's becoming similar to my NixOS configuration. Not as declarative and working out of the box as it requires a server but it's the closest thing. I'll explore more configurations as I go along. --- apps/emacs/tasks/main.yml | 11 ++++ roles/system/base/tasks/dev_extra.yml | 28 +++++++++ roles/system/base/tasks/dev_minimal.yml | 38 ++++++++++++ .../base/tasks/flatpak_desktop_apps.yml | 62 +++++++++++++++++++ roles/system/base/tasks/fonts.yml | 11 ++++ roles/system/base/tasks/i18n.yml | 22 +++++++ roles/system/base/tasks/main.yml | 20 ++++++ 7 files changed, 192 insertions(+) create mode 100644 apps/emacs/tasks/main.yml create mode 100644 roles/system/base/tasks/dev_extra.yml create mode 100644 roles/system/base/tasks/dev_minimal.yml create mode 100644 roles/system/base/tasks/flatpak_desktop_apps.yml create mode 100644 roles/system/base/tasks/fonts.yml create mode 100644 roles/system/base/tasks/i18n.yml create mode 100644 roles/system/base/tasks/main.yml diff --git a/apps/emacs/tasks/main.yml b/apps/emacs/tasks/main.yml new file mode 100644 index 0000000..1d1256c --- /dev/null +++ b/apps/emacs/tasks/main.yml @@ -0,0 +1,11 @@ +--- +- name: Install (Doom) Emacs with its required dependencies + package: + state: present + name: + - emacs + - libvterm + - aspell + - aspell-en + - wordnet + - zstd diff --git a/roles/system/base/tasks/dev_extra.yml b/roles/system/base/tasks/dev_extra.yml new file mode 100644 index 0000000..8d66d86 --- /dev/null +++ b/roles/system/base/tasks/dev_extra.yml @@ -0,0 +1,28 @@ +--- +- name: Install additional development tools + dnf: + state: present + name: + - tealdeer + - bat + - fzf + - exa + - ripgrep + - sqlite + - zoxide + - direnv + +- name: Install extra dependencies + dnf: + state: present + name: + - editorconfig + - ImageMagick + - ImageMagick-doc + - ImageMagick-libs + - hyperfine + - libtree-sitter + - recoll + - recoll-gssp + - recoll-kio + - starship diff --git a/roles/system/base/tasks/dev_minimal.yml b/roles/system/base/tasks/dev_minimal.yml new file mode 100644 index 0000000..b5f23df --- /dev/null +++ b/roles/system/base/tasks/dev_minimal.yml @@ -0,0 +1,38 @@ +--- +- name: Set minimal development environment + dnf: + state: present + name: + - neovim + - python-neovim + - git + - just + - kitty + - kitty-doc + - kitty-terminfo + - man-db + - man-pages + +- name: Setup container development tools + dnf: + state: present + name: + - podman + - toolbox + - openssl + +- name: Install backup tools + dnf: + state: present + name: + - borgbackup + - borgmatic + +- name: Install extra build systems + dnf: + state: present + name: + - cmake + - make + - meson + - ninja-build diff --git a/roles/system/base/tasks/flatpak_desktop_apps.yml b/roles/system/base/tasks/flatpak_desktop_apps.yml new file mode 100644 index 0000000..604960e --- /dev/null +++ b/roles/system/base/tasks/flatpak_desktop_apps.yml @@ -0,0 +1,62 @@ +--- +- name: Add Flatpak remotes + flatpak_remote: + state: present + name: "{{ item.name }}" + flatpakrepo_url: "{{ item.repo }}" + loop: + - name: flathub + repo: "https://flathub.org/repo/flathub.flatpakrepo" + - name: flathub-beta + repo: "https://flathub.org/beta-repo/flathub-beta.flatpakrepo" + - name: gnome-nightly + repo: "https://nightly.gnome.org/gnome-nightly.flatpakrepo" + - name: kdeapps + repo: "https://distribute.kde.org/kdeapps.flatpakrepo" + +- name: Install applications from 'flathub' Flatpak remote + flatpak: + state: present + name: "{{ item }}" + remote: flathub + loop: + - com.github.tchx84.Flatseal + - com.github.wwmm.easyeffects + - com.obsproject.Studio + - com.play0ad.zeroad + - com.remnantsoftheprecursors.ROTP + - com.usebottles.bottles + - com.valvesoftware.Steam + - io.github.lainsce.Emulsion + - org.blender.Blender + - org.inkscape.Inkscape + - org.kde.krita + - org.musescore.MuseScore + - org.pipewire.Helvum + - org.zrythm.Zrythm + - re.sonny.Junction + - re.sonny.Tangram + +- name: Install applications from 'kdeapps' Flatpak remote + flatpak: + state: present + name: "{{ item }}" + remote: kdeapps + loop: + - org.kde.krita-nightly + +- name: Install applications from 'flathub-beta' Flatpak remote + flatpak: + state: present + name: "{{ item }}" + remote: flathub-beta + loop: + - net.lutris.Lutris + +- name: Install applications from 'gnome-nightly' Flatpak remote + flatpak: + state: present + name: "{{ item }}" + remote: gnome-nightly + loop: + - org.gimp.GIMP diff --git a/roles/system/base/tasks/fonts.yml b/roles/system/base/tasks/fonts.yml new file mode 100644 index 0000000..e94ab9d --- /dev/null +++ b/roles/system/base/tasks/fonts.yml @@ -0,0 +1,11 @@ +--- +- name: Install fonts + dnf: + state: present + name: + - adobe-source-code-pro-fonts + - adobe-source-sans-pro-fonts + - adobe-source-serif-pro-fonts + - google-noto-emoji-fonts + - google-noto-sans-fonts + - google-noto-serif-fonts diff --git a/roles/system/base/tasks/i18n.yml b/roles/system/base/tasks/i18n.yml new file mode 100644 index 0000000..13bbb2a --- /dev/null +++ b/roles/system/base/tasks/i18n.yml @@ -0,0 +1,22 @@ +--- +- name: Install i18n tools + dnf: + state: present + name: + - fcitx5 + - fcitx5-configtool + - fcitx5-gtk4 + - fcitx5-lua + - fcitx5-mozc + - fcitx5-rime + - librime + - librime-tools + - mozc + +- name: Install fonts for i18n + dnf: + state: present + name: + - google-noto-cjk-fonts + - google-noto-cjk-fonts-common + diff --git a/roles/system/base/tasks/main.yml b/roles/system/base/tasks/main.yml new file mode 100644 index 0000000..74e4d2d --- /dev/null +++ b/roles/system/base/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- name: Install minimal development environment tools + include: dev_minimal.yml + tags: dev_minimal + +- name: Install additional development tools + include: dev_extra.yml + tags: dev_extra + +- name: Install Flatpak remotes and desktop applications (requires `flatpak`) + include: flatpak_desktop_apps.yml + tags: flatpak_desktop_apps + +- name: Install i18n-related tools + include: i18n.yml + tags: i18n + +- name: Install fonts + include: fonts.yml + tags: fonts