├── .ansible-lint ├── .github ├── renovate.json └── workflows │ └── lint.yml ├── .gitignore ├── .yamllint.yml ├── LICENSE ├── README.md ├── ansible.cfg ├── group_vars └── all.yml ├── hosts ├── main.yml ├── requirements.txt ├── requirements.yml └── roles ├── 01_host_info └── tasks │ └── main.yml ├── 02_basics ├── tasks │ └── main.yml └── templates │ ├── mirrorlist │ ├── pacman.conf.j2 │ └── reflector.conf.j2 ├── 03_display_server └── tasks │ └── main.yml ├── 04_desktop └── tasks │ └── main.yml ├── 05_packages └── tasks │ ├── aur.yml │ ├── flatpak.yml │ ├── fonts.yml │ └── main.yml ├── 06_microcode └── tasks │ └── main.yml ├── 07_users ├── tasks │ └── main.yml └── templates │ └── makepkg.conf ├── 08_printing_scanning └── tasks │ └── main.yml ├── 09_bluetooth └── tasks │ └── main.yml └── 10_laptop └── tasks └── main.yml /.ansible-lint: -------------------------------------------------------------------------------- 1 | --- 2 | enable_list: 3 | - fqcn-builtins # opt-in 4 | warn_list: 5 | - role-name 6 | - var-naming 7 | - yaml[truthy] 8 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended", 5 | "schedule:nonOfficeHours" 6 | ], 7 | "dependencyDashboard": true, 8 | "dependencyDashboardTitle": "Renovate Dashboard", 9 | "labels": [ 10 | "renovatebot" 11 | ], 12 | "packageRules": [ 13 | { 14 | "matchManagers": [ 15 | "ansible-galaxy", 16 | "pip_requirements" 17 | ], 18 | "matchUpdateTypes": [ 19 | "patch" 20 | ], 21 | "automerge": true, 22 | "automergeType": "pr", 23 | "platformAutomerge": true 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Lint 3 | 4 | on: 5 | push: 6 | branches: 7 | - main 8 | pull_request: 9 | schedule: 10 | - cron: "0 5 * * 0" 11 | workflow_dispatch: 12 | 13 | jobs: 14 | yamllint: 15 | name: yamllint 16 | 17 | runs-on: ubuntu-latest 18 | strategy: 19 | matrix: 20 | python-version: ['3.11', '3.12'] 21 | 22 | steps: 23 | - name: Check out the codebase 24 | uses: actions/checkout@v4 25 | 26 | - name: Set up Python ${{ matrix.python-version }} 27 | uses: actions/setup-python@v5 28 | with: 29 | python-version: ${{ matrix.python-version }} 30 | 31 | - name: Display Python version 32 | run: python -c "import sys; print(sys.version)" 33 | 34 | - name: Install dependencies 35 | run: | 36 | python -m pip install --upgrade pip 37 | pip3 install -r requirements.txt 38 | ansible-galaxy install -r requirements.yml 39 | 40 | - name: Install yamllint 41 | run: | 42 | python3 --version 43 | yamllint --version 44 | 45 | - name: List files to yamllint 46 | run: | 47 | yamllint --list-files . 48 | 49 | - name: Run yamllint 50 | run: | 51 | yamllint . 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Environments 2 | .env 3 | .venv 4 | env/ 5 | venv/ 6 | -------------------------------------------------------------------------------- /.yamllint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | 4 | rules: 5 | braces: 6 | level: warning 7 | max-spaces-inside: 1 8 | line-length: disable 9 | truthy: 10 | allowed-values: 11 | - "yes" 12 | - "true" 13 | - "no" 14 | - "false" 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Logan Marchione 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ansible-arch-linux 2 | 3 | [![Lint](https://github.com/loganmarchione/ansible-arch-linux/actions/workflows/lint.yml/badge.svg)](https://github.com/loganmarchione/ansible-arch-linux/actions/workflows/lint.yml) 4 | 5 | Ansible playbook to setup my Arch Linux machines (i.e., meant to be run against localhost) 6 | 7 | ## Explanation 8 | 9 | * This is meant for _my machine_. You can use it as a guide, but please don't blindly run it on your machine (it will break things). 10 | * This is meant to be run in the [Post-installation](https://wiki.archlinux.org/title/installation_guide#Post-installation) section of the [Installation guide](https://wiki.archlinux.org/title/installation_guide) (i.e., after your partitions are setup, user account is created, fstab is setup, chroot, etc...) 11 | 12 | ## Requirements 13 | 14 | 1. Install the necessary packages 15 | ``` 16 | sudo pacman -S git python 17 | ``` 18 | 1. Clone this repo 19 | ``` 20 | git clone https://github.com/loganmarchione/ansible-arch-linux.git 21 | cd ansible-arch-linux 22 | ``` 23 | 1. Install Ansible 24 | ``` 25 | python3 -m venv venv 26 | source venv/bin/activate 27 | pip3 install -r requirements.txt 28 | ``` 29 | 1. Install the Ansible requirements 30 | ``` 31 | ansible-galaxy install -r requirements.yml 32 | ``` 33 | 1. (Optional) Edit the variables in `group_vars` 34 | 1. (Optional) Run the playbook in check mode to view potential changes 35 | ``` 36 | ansible-playbook main.yml --ask-become-pass --check 37 | ```` 38 | 1. Run the playbook (enter your user's password when prompted) 39 | ``` 40 | ansible-playbook main.yml --ask-become-pass 41 | ``` -------------------------------------------------------------------------------- /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = hosts 3 | force_color=true 4 | 5 | [diff] 6 | always = yes -------------------------------------------------------------------------------- /group_vars/all.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # User configuration 4 | # 5 | user: 6 | name: logan 7 | full_name: "Logan Marchione" 8 | primary_group: users 9 | additional_groups: docker,wheel,render 10 | # /bin/bash or /bin/zsh 11 | shell: /bin/bash 12 | # See country list by running `reflector --list-countries` 13 | country: "United States" 14 | 15 | git: 16 | name: "{{ user['full_name'] }}" 17 | # obfuscated a little so bots won't find it 18 | email_b64: "bG9nYW5AbG9nYW5tYXJjaGlvbmUuY29t" 19 | # can be "cache", "store", "osxkeychain", or "manager" 20 | helper: "cache" 21 | # can be "true" or "false" 22 | rebase: "true" 23 | # see this https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---color-movedltmodegt 24 | colorMoved: "zebra" 25 | 26 | # 27 | # Miscellaneous 28 | # 29 | 30 | # desktop environment to install 31 | # "kde" or "gnome" 32 | desktop: kde 33 | 34 | # only AMD or Intel CPUs are currently supported 35 | # true or false 36 | install_microcode: true 37 | 38 | # whether to enable printing/scanning or not 39 | # true or false 40 | enable_printing: true 41 | 42 | # whether to detect the scanner or not 43 | # true or false 44 | detect_scanner: true 45 | 46 | # whether to enable bluetooth or not 47 | # true or false 48 | enable_bluetooth: false 49 | 50 | # whether to install laptop tools 51 | # true or false 52 | laptop: false 53 | 54 | # whether to install sunshine (game streaming) 55 | # true or false 56 | sunshine: true 57 | 58 | # how many parallel downloads to run at once 59 | pacman: 60 | parallel_downloads: 10 61 | 62 | # set aur helper 63 | # supported helpers are here https://github.com/kewlfft/ansible-aur#kewlfftauraur-module 64 | aur_helper: yay 65 | 66 | # 67 | # Services 68 | # 69 | 70 | # if not using LVM, disable it 71 | # true or false 72 | disable_lvm: true 73 | 74 | # if not using systemd homed, disable it 75 | # true or false 76 | disable_systemd_homed: true 77 | 78 | # 79 | # Packages 80 | # 81 | packages: 82 | - 7zip 83 | - alsa-firmware 84 | - alsa-plugins 85 | - alsa-utils 86 | - bash 87 | - bash-completion 88 | - borg 89 | - cadaver 90 | - chromium 91 | - code 92 | - curl 93 | - docker 94 | - docker-compose 95 | - dosfstools 96 | - e2fsprogs 97 | - exfatprogs 98 | - ffmpeg 99 | - firefox 100 | - flatpak 101 | - fwupd 102 | - fzf 103 | - git 104 | - gnupg 105 | - gparted 106 | - gst-libav 107 | - gst-plugins-bad 108 | - gst-plugins-base 109 | - gst-plugins-good 110 | - gvfs 111 | - gvfs-afc 112 | - gvfs-gphoto2 113 | - gvfs-smb 114 | - htop 115 | - ifuse 116 | - inkscape 117 | - inetutils 118 | - iotop 119 | - iperf3 120 | - iputils 121 | - jq 122 | - keepassxc 123 | - kubectl 124 | - lame 125 | - libimobiledevice 126 | - linux-firmware 127 | - man 128 | - man-db 129 | - man-pages 130 | - minicom 131 | - mkvtoolnix-cli 132 | - ncdu 133 | - networkmanager 134 | - nextcloud-client 135 | - nextcloud-client-cloudproviders 136 | - ntfs-3g 137 | - nvme-cli 138 | - openresolv 139 | - openssh 140 | - openvpn 141 | - picocom 142 | - pipewire 143 | - pipewire-alsa 144 | - pkgstats 145 | - rpi-imager 146 | - rsync 147 | - screen 148 | - solaar 149 | - steam 150 | - sudo 151 | - thunar 152 | - tree 153 | - unrar-free 154 | - unzip 155 | - usbutils 156 | - vi 157 | - vim 158 | - vlc 159 | - wget 160 | - wireguard-tools 161 | - wireplumber 162 | - wpa_supplicant 163 | # Needed for GTK apps that run as Flatpaks 164 | - xdg-desktop-portal-gtk 165 | - xfsprogs 166 | - yt-dlp 167 | - zip 168 | - zstd 169 | 170 | aur_packages: 171 | - makemkv 172 | - svgo 173 | 174 | flatpaks: 175 | - com.discordapp.Discord 176 | - com.github.PintaProject.Pinta 177 | - com.github.tchx84.Flatseal 178 | - com.slack.Slack 179 | - com.spotify.Client 180 | - fr.handbrake.ghb 181 | - info.beyondallreason.bar 182 | - org.bunkus.mkvtoolnix-gui 183 | - org.freedesktop.Platform.ffmpeg-full/x86_64/23.08 184 | - org.freedesktop.Platform.openh264/x86_64/2.3.0 185 | - org.gimp.GIMP 186 | - io.github.flattool.Warehouse 187 | - it.mijorus.gearlever 188 | - md.obsidian.Obsidian 189 | - org.gtk.Gtk3theme.Adwaita-dark 190 | - org.gtk.Gtk3theme.Yaru-dark 191 | - org.gtk.Gtk3theme.Yaru-light 192 | - org.libreoffice.LibreOffice 193 | - org.mozilla.Thunderbird 194 | - org.remmina.Remmina 195 | - org.tenacityaudio.Tenacity 196 | - us.zoom.Zoom 197 | # See other themes here 198 | # flatpak remote-ls flathub | grep org.gtk.Gtk3theme 199 | 200 | base_fonts: 201 | - adobe-source-code-pro-fonts 202 | - adobe-source-han-sans-jp-fonts 203 | - adobe-source-sans-pro-fonts 204 | - adobe-source-serif-pro-fonts 205 | - gnu-free-fonts 206 | - noto-fonts 207 | - noto-fonts-cjk 208 | - noto-fonts-emoji 209 | - powerline-fonts 210 | - ttf-anonymous-pro 211 | - ttf-dejavu 212 | - otf-cascadia-code 213 | - ttf-cascadia-code 214 | - ttf-hack 215 | - ttf-liberation 216 | 217 | vscode_extension_list: 218 | - arcticicestudio.nord-visual-studio-code 219 | - dracula-theme.theme-dracula 220 | - eamodio.gitlens 221 | - golang.go 222 | - HashiCorp.HCL 223 | - HashiCorp.terraform 224 | - ms-azuretools.vscode-docker 225 | - ms-python.python 226 | - redhat.ansible 227 | - redhat.vscode-xml 228 | - redhat.vscode-yaml 229 | - streetsidesoftware.code-spell-checker 230 | - vscode-icons-team.vscode-icons 231 | 232 | printing_scanning_packages: 233 | - cups 234 | - cups-pdf 235 | - sane 236 | - sane-airscan 237 | - simple-scan 238 | 239 | printing_scanning_aur_packages: 240 | - brlaser-git 241 | - brscan4 242 | -------------------------------------------------------------------------------- /hosts: -------------------------------------------------------------------------------- 1 | [all] 2 | 127.0.0.1 ansible_connection=local -------------------------------------------------------------------------------- /main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Main play 3 | hosts: all 4 | roles: 5 | - { role: 01_host_info } 6 | - { role: 02_basics } 7 | - { role: 03_display_server } 8 | - { role: 04_desktop } 9 | - { role: 05_packages } 10 | - { role: 06_microcode, when: install_microcode } 11 | - { role: 07_users } 12 | - { role: 08_printing_scanning, when: enable_printing } 13 | - { role: 09_bluetooth, when: enable_bluetooth } 14 | - { role: 10_laptop, when: laptop } 15 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | ansible==11.6.0 2 | ansible-lint==25.5.0 3 | PyYAML==6.0.2 4 | yamllint==1.37.1 5 | -------------------------------------------------------------------------------- /requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - name: community.general 4 | version: 10.7.0 5 | source: https://galaxy.ansible.com 6 | - name: kewlfft.aur 7 | version: 0.11.1 8 | source: https://galaxy.ansible.com 9 | -------------------------------------------------------------------------------- /roles/01_host_info/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check distribution is supported 3 | ansible.builtin.assert: 4 | that: ansible_distribution == "Archlinux" 5 | fail_msg: "Distribution '{{ ansible_distribution }}' is not supported." 6 | success_msg: "I run Arch, btw" 7 | -------------------------------------------------------------------------------- /roles/02_basics/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Start systemd service - systemd-timesyncd 3 | ansible.builtin.systemd: 4 | name: systemd-timesyncd 5 | state: started 6 | enabled: yes 7 | become: true 8 | 9 | - name: Install packages 10 | community.general.pacman: 11 | name: 12 | - reflector 13 | - pacman-contrib 14 | - xdg-desktop-portal 15 | - xdg-user-dirs 16 | state: present 17 | become: true 18 | 19 | - name: Start systemd service - paccache.timer 20 | ansible.builtin.systemd: 21 | name: paccache.timer 22 | state: started 23 | enabled: yes 24 | become: true 25 | 26 | - name: Start systemd service - xdg-user-dirs-update.service 27 | ansible.builtin.systemd: 28 | name: xdg-user-dirs-update.service 29 | state: started 30 | enabled: yes 31 | scope: user 32 | 33 | - name: Update reflector configuration file 34 | ansible.builtin.template: 35 | src: reflector.conf.j2 36 | dest: /etc/xdg/reflector/reflector.conf 37 | backup: no 38 | owner: root 39 | group: root 40 | mode: 0644 41 | become: true 42 | 43 | - name: Update mirrorlist 44 | ansible.builtin.template: 45 | src: mirrorlist 46 | dest: /etc/pacman.d/mirrorlist 47 | backup: no 48 | owner: root 49 | group: root 50 | mode: 0644 51 | become: true 52 | 53 | - name: Update pacman configuration file 54 | ansible.builtin.template: 55 | src: pacman.conf.j2 56 | dest: /etc/pacman.conf 57 | backup: no 58 | owner: root 59 | group: root 60 | mode: 0644 61 | become: true 62 | 63 | - name: Start systemd service - systemd-boot-update.service 64 | ansible.builtin.systemd: 65 | name: systemd-boot-update.service 66 | state: started 67 | enabled: yes 68 | become: true 69 | 70 | - name: Upgrade system 71 | community.general.pacman: 72 | update_cache: yes 73 | upgrade: yes 74 | become: true 75 | -------------------------------------------------------------------------------- /roles/02_basics/templates/mirrorlist: -------------------------------------------------------------------------------- 1 | ## 2 | ## Generated on 2024-05-31 3 | ## 4 | 5 | #Server = https://mirror.pit.teraswitch.com/archlinux/$repo/os/$arch 6 | Server = https://mirrors.rit.edu/archlinux/$repo/os/$arch 7 | Server = https://mirrors.ocf.berkeley.edu/archlinux/$repo/os/$arch 8 | Server = https://plug-mirror.rcac.purdue.edu/archlinux/$repo/os/$arch 9 | Server = https://mirrors.lug.mtu.edu/archlinux/$repo/os/$arch 10 | Server = https://mirrors.mit.edu/archlinux/$repo/os/$arch 11 | Server = https://iad.mirror.rackspace.com/archlinux/$repo/os/$arch 12 | Server = https://dfw.mirror.rackspace.com/archlinux/$repo/os/$arch 13 | Server = https://ord.mirror.rackspace.com/archlinux/$repo/os/$arch 14 | Server = https://america.mirror.pkgbuild.com/$repo/os/$arch 15 | Server = https://mirrors.kernel.org/archlinux/$repo/os/$arch 16 | -------------------------------------------------------------------------------- /roles/02_basics/templates/pacman.conf.j2: -------------------------------------------------------------------------------- 1 | # 2 | # /etc/pacman.conf 3 | # 4 | # See the pacman.conf(5) manpage for option and repository directives 5 | 6 | # 7 | # GENERAL OPTIONS 8 | # 9 | [options] 10 | # The following paths are commented out with their default values listed. 11 | # If you wish to use different paths, uncomment and update the paths. 12 | #RootDir = / 13 | #DBPath = /var/lib/pacman/ 14 | #CacheDir = /var/cache/pacman/pkg/ 15 | #LogFile = /var/log/pacman.log 16 | #GPGDir = /etc/pacman.d/gnupg/ 17 | #HookDir = /etc/pacman.d/hooks/ 18 | HoldPkg = pacman glibc 19 | #XferCommand = /usr/bin/curl -L -C - -f -o %o %u 20 | #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u 21 | #CleanMethod = KeepInstalled 22 | Architecture = auto 23 | 24 | # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup 25 | #IgnorePkg = 26 | #IgnoreGroup = 27 | 28 | #NoUpgrade = 29 | #NoExtract = 30 | 31 | # Misc options 32 | #UseSyslog 33 | Color 34 | #NoProgressBar 35 | CheckSpace 36 | VerbosePkgLists 37 | ParallelDownloads = {{ pacman.parallel_downloads }} 38 | DownloadUser = alpm 39 | #DisableSandbox 40 | ILoveCandy 41 | 42 | # By default, pacman accepts packages signed by keys that its local keyring 43 | # trusts (see pacman-key and its man page), as well as unsigned packages. 44 | SigLevel = Required DatabaseOptional 45 | LocalFileSigLevel = Optional 46 | #RemoteFileSigLevel = Required 47 | 48 | # NOTE: You must run `pacman-key --init` before first using pacman; the local 49 | # keyring can then be populated with the keys of all official Arch Linux 50 | # packagers with `pacman-key --populate archlinux`. 51 | 52 | # 53 | # REPOSITORIES 54 | # - can be defined here or included from another file 55 | # - pacman will search repositories in the order defined here 56 | # - local/custom mirrors can be added here or in separate files 57 | # - repositories listed first will take precedence when packages 58 | # have identical names, regardless of version number 59 | # - URLs will have $repo replaced by the name of the current repo 60 | # - URLs will have $arch replaced by the name of the architecture 61 | # 62 | # Repository entries are of the format: 63 | # [repo-name] 64 | # Server = ServerName 65 | # Include = IncludePath 66 | # 67 | # The header [repo-name] is crucial - it must be present and 68 | # uncommented to enable the repo. 69 | # 70 | 71 | # The testing repositories are disabled by default. To enable, uncomment the 72 | # repo name header and Include lines. You can add preferred servers immediately 73 | # after the header, and they will be used before the default mirrors. 74 | 75 | #[core-testing] 76 | #Include = /etc/pacman.d/mirrorlist 77 | 78 | [core] 79 | Include = /etc/pacman.d/mirrorlist 80 | 81 | #[extra-testing] 82 | #Include = /etc/pacman.d/mirrorlist 83 | 84 | [extra] 85 | Include = /etc/pacman.d/mirrorlist 86 | 87 | # If you want to run 32 bit applications on your x86_64 system, 88 | # enable the multilib repositories as required here. 89 | 90 | #[multilib-testing] 91 | #Include = /etc/pacman.d/mirrorlist 92 | 93 | [multilib] 94 | Include = /etc/pacman.d/mirrorlist 95 | 96 | # An example of a custom package repository. See the pacman manpage for 97 | # tips on creating your own repositories. 98 | #[custom] 99 | #SigLevel = Optional TrustAll 100 | #Server = file:///home/custompkgs 101 | 102 | {% if sunshine | default(false) | bool %} 103 | [lizardbyte] 104 | SigLevel = Optional 105 | Server = https://github.com/LizardByte/pacman-repo/releases/latest/download 106 | {% endif %} -------------------------------------------------------------------------------- /roles/02_basics/templates/reflector.conf.j2: -------------------------------------------------------------------------------- 1 | --save /etc/pacman.d/mirrorlist 2 | --country "{{ user.country }}" 3 | --protocol https 4 | --sort rate 5 | --age 24 6 | --latest 10 -------------------------------------------------------------------------------- /roles/03_display_server/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Xorg 3 | community.general.pacman: 4 | name: 5 | - xorg-xwayland 6 | state: present 7 | become: true 8 | 9 | - name: Detect GPU 10 | # ansible.builtin.shell: set -o pipefail && lspci -v | grep -A1 -e VGA -e 3D # noqa command-instead-of-shell 11 | ansible.builtin.shell: set -o pipefail && lspci | grep -i 'VGA\|3D\|display' # noqa command-instead-of-shell 12 | register: gpu_result 13 | changed_when: no 14 | 15 | - name: Install GPU drivers (AMD) 16 | community.general.pacman: 17 | name: 18 | - mesa 19 | - mesa-utils 20 | - lib32-mesa 21 | - lib32-mesa-utils 22 | # https://wiki.archlinux.org/title/Xorg 23 | - xf86-video-amdgpu 24 | # https://wiki.archlinux.org/title/Hardware_video_acceleration 25 | - mesa-vdpau 26 | - libva-mesa-driver 27 | # https://wiki.archlinux.org/title/Vulkan 28 | - vulkan-radeon 29 | - lib32-vulkan-radeon 30 | # https://wiki.archlinux.org/title/GPGPU 31 | - rocm-hip-runtime 32 | - rocm-hip-sdk 33 | - hip-runtime-amd 34 | - rocm-core 35 | - rocm-opencl-runtime 36 | - rocm-opencl-sdk 37 | state: present 38 | become: true 39 | when: ("'radeon' in gpu_result.stdout.lower()") or ("'amd/ati' in gpu_result.stdout.lower()") 40 | 41 | - name: Install GPU drivers (Intel) 42 | community.general.pacman: 43 | name: 44 | - mesa 45 | - mesa-utils 46 | - lib32-mesa 47 | - lib32-mesa-utils 48 | # https://wiki.archlinux.org/title/Xorg 49 | - xf86-video-intel 50 | # https://wiki.archlinux.org/title/Hardware_video_acceleration 51 | - intel-media-driver 52 | - libva-intel-driver 53 | # https://wiki.archlinux.org/title/Vulkan 54 | - vulkan-intel 55 | - lib32-vulkan-intel 56 | # https://wiki.archlinux.org/title/GPGPU 57 | - intel-compute-runtime 58 | - opencl-clover-mesa 59 | state: present 60 | become: true 61 | when: "'intel' in gpu_result.stdout.lower()" 62 | 63 | - name: Install GPU drivers (Nvidia) 64 | community.general.pacman: 65 | name: 66 | - mesa 67 | - mesa-utils 68 | - lib32-mesa 69 | - lib32-mesa-utils 70 | # https://wiki.archlinux.org/title/Xorg 71 | - nvidia 72 | # https://wiki.archlinux.org/title/Hardware_video_acceleration 73 | - nvidia-utils 74 | - lib32-nvidia-utils 75 | # https://wiki.archlinux.org/title/GPGPU 76 | - cuda 77 | - opencl-nvidia 78 | state: present 79 | become: true 80 | when: "'nvidia' in gpu_result.stdout.lower()" 81 | -------------------------------------------------------------------------------- /roles/04_desktop/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install desktop environment 3 | when: desktop == "kde" 4 | block: 5 | - name: Install Plasma 6 | community.general.pacman: 7 | name: 8 | # KDE apps/bundles 9 | - plasma-meta 10 | - plasma-workspace 11 | - kde-sdk-meta 12 | - kde-system-meta 13 | - kde-utilities-meta 14 | - sddm 15 | - xdg-desktop-portal-kde 16 | # Individual apps 17 | - colord-kde 18 | - ffmpegthumbs 19 | - gwenview 20 | - kamoso 21 | - kcolorchooser 22 | - kdeconnect 23 | - kdegraphics-mobipocket 24 | - kdegraphics-thumbnailers 25 | - kdenetwork-filesharing 26 | - kfilemetadata 27 | - kio-extras 28 | - kio-fuse 29 | - kio-zeroconf 30 | - kleopatra 31 | - kmix 32 | - kolourpaint 33 | - kparts 34 | - okular 35 | - spectacle 36 | - svgpart 37 | state: present 38 | become: true 39 | 40 | - name: Start systemd service - sddm.service 41 | ansible.builtin.systemd: 42 | name: sddm.service 43 | enabled: yes 44 | become: true 45 | 46 | - name: Install desktop environment 47 | when: desktop == "gnome" 48 | block: 49 | - name: Install Gnome 50 | community.general.pacman: 51 | name: 52 | - gnome 53 | - gnome-shell 54 | - gnome-control-center 55 | - gdm 56 | - xdg-desktop-portal-gnome 57 | state: present 58 | become: true 59 | 60 | - name: Start systemd service - gdm.service 61 | ansible.builtin.systemd: 62 | name: gdm.service 63 | enabled: yes 64 | become: true 65 | -------------------------------------------------------------------------------- /roles/05_packages/tasks/aur.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Installing AUR helper 3 | kewlfft.aur.aur: 4 | name: "{{ aur_helper }}" 5 | 6 | - name: Install AUR packages 7 | kewlfft.aur.aur: 8 | name: "{{ aur_packages }}" 9 | state: present 10 | use: "{{ aur_helper }}" 11 | -------------------------------------------------------------------------------- /roles/05_packages/tasks/flatpak.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Add Flathub repository 3 | community.general.flatpak_remote: 4 | name: flathub 5 | state: present 6 | flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo 7 | become: true 8 | 9 | - name: Install flatpaks 10 | community.general.flatpak: 11 | name: "{{ flatpaks }}" 12 | state: present 13 | remote: flathub 14 | -------------------------------------------------------------------------------- /roles/05_packages/tasks/fonts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install fonts 3 | community.general.pacman: 4 | name: "{{ base_fonts }}" 5 | state: present 6 | become: true 7 | -------------------------------------------------------------------------------- /roles/05_packages/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install packages 3 | community.general.pacman: 4 | name: "{{ packages }}" 5 | state: present 6 | become: true 7 | 8 | - name: Install Sunshine 9 | community.general.pacman: 10 | name: "lizardbyte/sunshine" 11 | state: present 12 | become: true 13 | when: 14 | - sunshine | default(false) | bool 15 | 16 | - name: Install font packages 17 | ansible.builtin.import_tasks: fonts.yml 18 | 19 | - name: Install aur packages 20 | ansible.builtin.import_tasks: aur.yml 21 | 22 | - name: Install flatpaks 23 | ansible.builtin.import_tasks: flatpak.yml 24 | 25 | - name: Start systemd service - systemd-modules-load.service 26 | ansible.builtin.systemd: 27 | name: systemd-modules-load.service 28 | state: started 29 | enabled: yes 30 | become: true 31 | -------------------------------------------------------------------------------- /roles/06_microcode/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install microcode (AMD) 3 | community.general.pacman: 4 | name: 5 | - amd-ucode 6 | become: true 7 | when: "'AuthenticAMD' in ansible_processor" 8 | 9 | - name: Install microcode (Intel) 10 | community.general.pacman: 11 | name: 12 | - intel-ucode 13 | become: true 14 | when: "'GenuineIntel' in ansible_processor" 15 | -------------------------------------------------------------------------------- /roles/07_users/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Create user 3 | ansible.builtin.user: 4 | name: "{{ user.name }}" 5 | comment: "{{ user.full_name }}" 6 | groups: "{{ user.additional_groups }}" 7 | append: yes 8 | shell: "{{ user.shell }}" 9 | state: present 10 | become: true 11 | 12 | - name: Git config user.name 13 | community.general.git_config: 14 | name: user.name 15 | scope: global 16 | value: "{{ git.name }}" 17 | 18 | - name: Git config user.email 19 | community.general.git_config: 20 | name: user.email 21 | scope: global 22 | value: "{{ git.email_b64 | b64decode }}" 23 | 24 | - name: Git config credential.helper 25 | community.general.git_config: 26 | name: credential.helper 27 | scope: global 28 | value: "{{ git.helper }}" 29 | 30 | - name: Git config pull.rebase 31 | community.general.git_config: 32 | name: pull.rebase 33 | scope: global 34 | value: "{{ git.rebase }}" 35 | 36 | - name: Git config diff.colorMoved 37 | community.general.git_config: 38 | name: diff.colorMoved 39 | scope: global 40 | value: "{{ git.colorMoved }}" 41 | 42 | - name: Install VS Code extensions 43 | ansible.builtin.shell: code --install-extension {{ item }} # noqa command-instead-of-shell 44 | with_items: "{{ vscode_extension_list }}" 45 | changed_when: no 46 | 47 | - name: Get dotfiles 48 | ansible.builtin.get_url: 49 | url: '{{ item.src }}' 50 | dest: '{{ item.dest }}' 51 | mode: 0644 52 | owner: "{{ user.name }}" 53 | group: "{{ user.primary_group }}" 54 | with_items: 55 | - { src: 'https://raw.githubusercontent.com/loganmarchione/dotfiles/main/.aliases', dest: '/home/logan/.aliases' } 56 | - { src: 'https://raw.githubusercontent.com/loganmarchione/dotfiles/main/.vimrc', dest: '/home/logan/.vimrc' } 57 | - { src: 'https://raw.githubusercontent.com/loganmarchione/dotfiles/main/.bashrc', dest: '/home/logan/.bashrc' } 58 | - { src: 'https://raw.githubusercontent.com/loganmarchione/dotfiles/main/.zshrc', dest: '/home/logan/.zshrc' } 59 | - { src: 'https://raw.githubusercontent.com/loganmarchione/dotfiles/main/.p10k.zsh', dest: '/home/logan/.p10k.zsh' } 60 | 61 | - name: Update makepkg configuration file 62 | ansible.builtin.template: 63 | src: makepkg.conf 64 | dest: "/home/{{ user.name }}/.makepkg.conf" 65 | backup: no 66 | owner: "{{ user.name }}" 67 | group: "{{ user.primary_group }}" 68 | mode: 0644 69 | 70 | - name: Mask systemd services - lvm 71 | ansible.builtin.systemd: 72 | name: "{{ item }}" 73 | masked: yes 74 | become: true 75 | with_items: 76 | - lvm2-lvmetad.service 77 | - lvm2-lvmetad.socket 78 | - lvm2-monitor.service 79 | when: disable_lvm 80 | 81 | - name: Mask systemd services - systemd homed 82 | ansible.builtin.systemd: 83 | name: "{{ item }}" 84 | masked: yes 85 | become: true 86 | with_items: 87 | - systemd-homed.service 88 | - systemd-userdbd.service 89 | - systemd-userdbd.socket 90 | when: disable_systemd_homed 91 | -------------------------------------------------------------------------------- /roles/07_users/templates/makepkg.conf: -------------------------------------------------------------------------------- 1 | MAKEFLAGS="-j$(nproc)" 2 | -------------------------------------------------------------------------------- /roles/08_printing_scanning/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install printing and scanning packages 3 | community.general.pacman: 4 | name: "{{ printing_scanning_packages }}" 5 | become: true 6 | 7 | - name: Install printing and scanning packages (AUR) 8 | kewlfft.aur.aur: 9 | name: "{{ printing_scanning_aur_packages }}" 10 | state: present 11 | use: "{{ aur_helper }}" 12 | 13 | - name: Start systemd service - cups.socket 14 | ansible.builtin.systemd: 15 | name: cups.socket 16 | state: started 17 | enabled: yes 18 | become: true 19 | 20 | - name: Detect scanner 21 | ansible.builtin.shell: set -o pipefail && scanimage -L # noqa command-instead-of-shell 22 | register: scanimage_result 23 | changed_when: no 24 | when: detect_scanner 25 | 26 | - name: Display scanner 27 | ansible.builtin.debug: 28 | msg: 29 | - "Detected the scanner below" 30 | - "{{ scanimage_result.stdout }}" 31 | when: detect_scanner 32 | -------------------------------------------------------------------------------- /roles/09_bluetooth/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install bluetooth packages 3 | community.general.pacman: 4 | name: 5 | - bluez 6 | - bluez-utils 7 | state: present 8 | become: true 9 | 10 | - name: Start systemd service - bluetooth.service 11 | ansible.builtin.systemd: 12 | name: bluetooth.service 13 | state: started 14 | enabled: yes 15 | become: true 16 | -------------------------------------------------------------------------------- /roles/10_laptop/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install power management packages 3 | community.general.pacman: 4 | name: 5 | - power-profiles-daemon 6 | state: present 7 | become: true 8 | 9 | - name: Start systemd service - power-profiles-daemon.service 10 | ansible.builtin.systemd: 11 | name: power-profiles-daemon.service 12 | state: started 13 | enabled: yes 14 | become: true 15 | --------------------------------------------------------------------------------