New roles: - workstation: Arch base (yay, UV, Hyprland, tiling tools, fonts, productivity apps, NVIDIA auto-detect, tmux + TPM) - dev_apps: optional dev tools (PyCharm, R/RStudio, databases) - claude_code: Claude Code CLI install/update via npm - user_bootstrap: fresh machine user setup (SSH key, sudo) CLI/shell/terminal setup excluded — handled by existing cli_modern role. workstation.yml runs cli_modern first, then workstation roles in phases. All roles tagged for selective deployment. Passes ansible-lint at production level.
204 lines
6.4 KiB
YAML
204 lines
6.4 KiB
YAML
---
|
|
# workstation — Arch Linux base system setup
|
|
# Handles: system packages, yay (AUR), UV, Hyprland, tiling WM tools,
|
|
# fonts, productivity apps, NVIDIA, tmux.
|
|
# Does NOT handle: shell, prompt, CLI tools (that's cli_modern).
|
|
|
|
- name: Update system packages
|
|
community.general.pacman:
|
|
update_cache: true
|
|
upgrade: true
|
|
|
|
- name: Install base development packages
|
|
community.general.pacman:
|
|
name:
|
|
- base-devel
|
|
- git
|
|
- curl
|
|
- wget
|
|
- openssh
|
|
- python
|
|
- python-pip
|
|
- nodejs
|
|
- npm
|
|
state: present
|
|
|
|
# ── yay (AUR helper) ────────────────────────────────────────────────────
|
|
|
|
- name: Check if yay is installed
|
|
ansible.builtin.command: which yay
|
|
register: workstation_yay_check
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Install yay
|
|
when: workstation_install_yay and workstation_yay_check.rc != 0
|
|
become: true
|
|
become_user: "{{ workstation_user }}"
|
|
block:
|
|
- name: Clone yay repository
|
|
ansible.builtin.git:
|
|
repo: https://aur.archlinux.org/yay.git
|
|
dest: "{{ workstation_user_home }}/yay"
|
|
clone: true
|
|
version: master
|
|
|
|
- name: Build and install yay
|
|
ansible.builtin.shell: cd "{{ workstation_user_home }}/yay" && makepkg -si --noconfirm
|
|
register: workstation_yay_build
|
|
changed_when: workstation_yay_build.rc == 0
|
|
|
|
- name: Clean up yay build directory
|
|
ansible.builtin.file:
|
|
path: "{{ workstation_user_home }}/yay"
|
|
state: absent
|
|
|
|
# ── UV package manager ──────────────────────────────────────────────────
|
|
|
|
- name: Install UV via yay
|
|
become: true
|
|
become_user: "{{ workstation_user }}"
|
|
ansible.builtin.command: yay -S --noconfirm uv
|
|
register: workstation_uv_result
|
|
changed_when: "'installing' in workstation_uv_result.stdout | default('')"
|
|
failed_when: false
|
|
when: workstation_install_uv
|
|
|
|
- name: Create UV config directory
|
|
become: true
|
|
become_user: "{{ workstation_user }}"
|
|
ansible.builtin.file:
|
|
path: "{{ workstation_user_home }}/.config/uv"
|
|
state: directory
|
|
mode: "0755"
|
|
when: workstation_install_uv
|
|
|
|
# ── Hyprland ────────────────────────────────────────────────────────────
|
|
|
|
- name: Install Hyprland
|
|
community.general.pacman:
|
|
name: hyprland
|
|
state: present
|
|
when: workstation_install_hyprland
|
|
|
|
- name: Check if hyprland-starter is already cloned
|
|
become: true
|
|
become_user: "{{ workstation_user }}"
|
|
ansible.builtin.stat:
|
|
path: "{{ workstation_user_home }}/hyprland-starter"
|
|
register: workstation_hyprland_dir
|
|
|
|
- name: Clone hyprland-starter
|
|
become: true
|
|
become_user: "{{ workstation_user }}"
|
|
ansible.builtin.git:
|
|
repo: https://github.com/mylinuxforwork/hyprland-starter
|
|
dest: "{{ workstation_user_home }}/hyprland-starter"
|
|
depth: 1
|
|
version: main
|
|
when: workstation_install_hyprland and not workstation_hyprland_dir.stat.exists
|
|
|
|
# ── Tiling WM tools ────────────────────────────────────────────────────
|
|
|
|
- name: Install tiling WM tools
|
|
community.general.pacman:
|
|
name:
|
|
- rofi
|
|
- dunst
|
|
- picom
|
|
- feh
|
|
- sxhkd
|
|
- lxappearance
|
|
- i3status
|
|
- dmenu
|
|
- i3lock
|
|
state: present
|
|
when: workstation_install_tiling_tools
|
|
|
|
# ── Fonts ───────────────────────────────────────────────────────────────
|
|
|
|
- name: Install fonts
|
|
community.general.pacman:
|
|
name:
|
|
- ttf-dejavu
|
|
- ttf-liberation
|
|
- noto-fonts
|
|
- noto-fonts-emoji
|
|
state: present
|
|
when: workstation_install_fonts
|
|
|
|
- name: Install Nerd Font via yay
|
|
become: true
|
|
become_user: "{{ workstation_user }}"
|
|
ansible.builtin.command: yay -S --noconfirm ttf-firacode-nerd
|
|
register: workstation_nerd_font
|
|
changed_when: "'installing' in workstation_nerd_font.stdout | default('')"
|
|
failed_when: false
|
|
when: workstation_install_fonts
|
|
|
|
# ── Productivity tools ──────────────────────────────────────────────────
|
|
|
|
- name: Install productivity tools
|
|
community.general.pacman:
|
|
name:
|
|
- flameshot
|
|
- meld
|
|
- zeal
|
|
- btop
|
|
- ranger
|
|
- timeshift
|
|
- syncthing
|
|
- keepassxc
|
|
state: present
|
|
when: workstation_install_productivity
|
|
|
|
# ── NVIDIA ──────────────────────────────────────────────────────────────
|
|
|
|
- name: Check for NVIDIA GPU
|
|
ansible.builtin.command: lspci
|
|
register: workstation_lspci
|
|
changed_when: false
|
|
failed_when: false
|
|
when: workstation_install_nvidia == "auto" or workstation_install_nvidia | bool
|
|
|
|
- name: Set NVIDIA detected fact
|
|
ansible.builtin.set_fact:
|
|
workstation_has_nvidia: "{{ 'NVIDIA' in (workstation_lspci.stdout | default('') | upper) }}"
|
|
|
|
- name: Install NVIDIA CUDA support
|
|
community.general.pacman:
|
|
name:
|
|
- cuda
|
|
- cudnn
|
|
state: present
|
|
when: >
|
|
(workstation_install_nvidia == "auto" and workstation_has_nvidia | bool) or
|
|
(workstation_install_nvidia | bool and workstation_install_nvidia != "auto")
|
|
|
|
# ── tmux ────────────────────────────────────────────────────────────────
|
|
|
|
- name: Install tmux
|
|
community.general.pacman:
|
|
name: tmux
|
|
state: present
|
|
when: workstation_install_tmux
|
|
|
|
- name: Create tmux config directory
|
|
become: true
|
|
become_user: "{{ workstation_user }}"
|
|
ansible.builtin.file:
|
|
path: "{{ workstation_user_home }}/.config/tmux/plugins"
|
|
state: directory
|
|
mode: "0755"
|
|
when: workstation_install_tmux
|
|
|
|
- name: Clone TPM (Tmux Plugin Manager)
|
|
become: true
|
|
become_user: "{{ workstation_user }}"
|
|
ansible.builtin.git:
|
|
repo: https://github.com/tmux-plugins/tpm
|
|
dest: "{{ workstation_user_home }}/.config/tmux/plugins/tpm"
|
|
version: master
|
|
update: true
|
|
when: workstation_install_tmux
|