- name: Setup home config files
  copy:
    src: "{{ item.src }}"
    dest: "/home/{{ main_user.name }}/"
    owner: "{{ main_user.name }}"
    group: users
  loop:
    - { src: "files/home/.moc" }
    - { src: "files/home/.emacs.d" }
    - { src: "files/home/.bashrc" }
    - { src: "files/home/.tmux.conf" }
    - { src: "files/home/create_backup.sh" }
    - { src: "files/home/create_hot_backup.sh" }
    - { src: "files/home/.gitconfig" }
    - { src: "files/home/.alacritty.toml" }
    - { src: "files/home/bin" }

- name: Setup .config dir
  copy:
    src: "{{ item.src }}"
    dest: "/home/{{ main_user.name }}/.config/"
    owner: "{{ main_user.name }}"
    group: users
  loop:
    - { src: "files/config/kitty" }
    - { src: "files/config/nvim" }
    - { src: "files/config/nsxiv" }

- name: Copy pacman.conf
  copy:
    src: files/system/pacman.conf
    dest: /etc/pacman.conf
    owner: root
    group: root

- name: Setup home config files
  when: display_server == 'xorg'
  copy:
    src: "{{ item.src }}"
    dest: "/home/{{ main_user.name }}/"
    owner: "{{ main_user.name }}"
    group: users
  loop:
    - { src: "home/.xinitrc" }
    - { src: "home/.Xresources" }

- name: Setup rofi theme
  when: display_server == 'xorg'
  copy:
    src: "files/config/rofi/themes/"
    dest: "/home/{{ main_user.name }}/.local/share/rofi/themes/"
    owner: "{{ main_user.name }}"
    group: users
