200 lines
4.9 KiB
YAML
200 lines
4.9 KiB
YAML
- name: Debug user variables
|
|
ansible.builtin.debug:
|
|
msg:
|
|
- "ansible_user_id: {{ ansible_user_id | default('NOT SET') }}"
|
|
- "ansible_env.USER: {{ ansible_env.USER | default('NOT SET') }}"
|
|
- "Current user from whoami: {{ ansible_facts['user_id'] | default('NOT SET') }}"
|
|
- " username {{ username }}"
|
|
- " userhome {{ user_home }}"
|
|
|
|
- name: Update system packages
|
|
community.general.pacman:
|
|
update_cache: true
|
|
upgrade: true
|
|
|
|
- name: Install development essentials
|
|
community.general.pacman:
|
|
name:
|
|
- fish
|
|
- base-devel
|
|
- git
|
|
- curl
|
|
- wget
|
|
- openssh
|
|
- python
|
|
- python-pip
|
|
- hyprland
|
|
- tmux
|
|
state: present
|
|
|
|
- name: Add nano settings
|
|
become: true
|
|
become_user: "{{ ansible_user_id }}"
|
|
ansible.builtin.copy:
|
|
content: nanorc
|
|
path: "{{ user_home }}/.nanorc"
|
|
state: directory
|
|
mode: '0644'
|
|
|
|
- name: Check if yay is installed
|
|
ansible.builtin.command: which yay
|
|
register: yay_installed
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Install yay (AUR helper)
|
|
when: yay_installed.rc != 0
|
|
become: false
|
|
block:
|
|
- name: Clone yay repository
|
|
ansible.builtin.git:
|
|
repo: https://aur.archlinux.org/yay.git
|
|
dest: "{{ user_home }}/yay"
|
|
clone: true
|
|
update: false
|
|
|
|
- name: Build and install yay
|
|
ansible.builtin.shell: |
|
|
cd "{{ user_home }}/yay" && makepkg -si --noconfirm
|
|
args:
|
|
chdir: "{{ user_home }}/yay"
|
|
register: yay_build_result
|
|
changed_when: yay_build_result.rc == 0
|
|
failed_when: yay_build_result.rc != 0
|
|
|
|
- name: Clean up yay build directory
|
|
ansible.builtin.file:
|
|
path: "{{ user_home }}/yay"
|
|
state: absent
|
|
|
|
- name: Install UV package manager
|
|
become: true
|
|
become_user: "{{ ansible_user_id }}"
|
|
ansible.builtin.command: yay -S --noconfirm uv
|
|
register: uv_result
|
|
changed_when: uv_result.rc == 0
|
|
failed_when: uv_result.rc != 0 and 'error' in uv_result.stderr
|
|
|
|
- name: Create UV config directory
|
|
become: true
|
|
become_user: "{{ ansible_user_id }}"
|
|
ansible.builtin.file:
|
|
path: "{{ user_home }}/.config/uv"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Check if hyprland starter is already cloned
|
|
become: true
|
|
become_user: "{{ ansible_user_id }}"
|
|
ansible.builtin.stat:
|
|
path: "{{ user_home }}/hyprland-started"
|
|
register: hyprland_starter_dir
|
|
|
|
- name: Install hyprland starter
|
|
become: true
|
|
become_user: "{{ ansible_user_id }}"
|
|
ansible.builtin.git:
|
|
repo: https://github.com/mylinuxforwork/hyprland-starter
|
|
dest: "{{ user_home }}/hyprland-started"
|
|
depth: 1
|
|
when: not hyprland_starter_dir.stat.exists
|
|
|
|
- name: Install tiling window manager
|
|
when: install_tiling_wm
|
|
community.general.pacman:
|
|
name:
|
|
# - "{{ tiling_wm }}"
|
|
- rofi
|
|
- dunst
|
|
- picom
|
|
- feh
|
|
- sxhkd
|
|
- lxappearance
|
|
- i3status
|
|
- dmenu
|
|
- i3lock
|
|
state: present
|
|
|
|
- name: Install productivity tools
|
|
community.general.pacman:
|
|
name:
|
|
- flameshot
|
|
- meld
|
|
- zeal
|
|
- tmux
|
|
- btop
|
|
- ranger
|
|
- timeshift
|
|
- syncthing
|
|
- keepassxc
|
|
state: present
|
|
|
|
- name: Install additional fonts
|
|
community.general.pacman:
|
|
name:
|
|
- ttf-dejavu
|
|
- ttf-liberation
|
|
- noto-fonts
|
|
- noto-fonts-emoji
|
|
state: present
|
|
|
|
- name: Check for NVIDIA GPU
|
|
ansible.builtin.shell: lspci | grep -i nvidia
|
|
register: has_nvidia
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Install NVIDIA CUDA support
|
|
when: has_nvidia.rc == 0
|
|
community.general.pacman:
|
|
name:
|
|
- cuda
|
|
- cudnn
|
|
state: present
|
|
# - name: Create project directories
|
|
# ansible.builtin.file:
|
|
# path: "{{ user_home }}/Projects/{{ item }}"
|
|
# state: directory
|
|
# mode: '0755'
|
|
# loop:
|
|
# - llm-dev
|
|
# - app-dev
|
|
# - data-analysis
|
|
# become: false
|
|
- name: Include custom apps tasks
|
|
ansible.builtin.include_tasks:
|
|
file: capps.yml
|
|
when: INSTALL_CUSTOM_APPS
|
|
|
|
- name: Include terms tasks
|
|
ansible.builtin.include_tasks:
|
|
file: terminals.yml
|
|
|
|
|
|
- name: Display completion message
|
|
ansible.builtin.debug:
|
|
msg: |
|
|
Development environment setup complete!
|
|
|
|
Access your local Git server at: http://localhost:{{ git_server_port }}
|
|
|
|
Remember to log out and back in for the docker group changes to take effect.
|
|
|
|
Python environments were not created as requested - use the following commands to set them up:
|
|
cd ~/projects/llm-dev
|
|
uv venv
|
|
source .venv/bin/activate
|
|
uv pip install torch transformers datasets huggingface_hub
|
|
|
|
Shells setup:
|
|
- ZSH with Powerlevel10k theme is installed
|
|
- Fish shell is also available, switch to it by typing 'fish'
|
|
|
|
Terminal:
|
|
- Alacritty has been configured as your terminal emulator
|
|
|
|
{% if install_tiling_wm %}
|
|
Window Manager:
|
|
- {{ tiling_wm }} has been installed as your tiling window manager
|
|
{% endif %}
|