--- - name: Hyprland - install packages community.general.pacman: name: "{{ hyprland_packages }}" state: present update_cache: yes tags: [hyprland, packages] - name: Hyprland - ensure configuration directories exist file: path: "/home/{{ system_user }}/.config/{{ item }}" state: directory owner: "{{ system_user }}" group: "{{ system_user }}" mode: '0755' loop: - hypr - waybar - wofi - dunst tags: [hyprland, config] - name: Hyprland - configure NVIDIA DRM KMS (modeset=1) lineinfile: path: /etc/modprobe.d/nvidia.conf line: "options nvidia-drm modeset=1" create: yes notify: rebuild initramfs tags: [hyprland, nvidia] - name: Hyprland - check if NVIDIA modules are already in mkinitcpio command: grep -q "nvidia nvidia_modeset nvidia_uvm nvidia_drm" /etc/mkinitcpio.conf register: mkinitcpio_check failed_when: false changed_when: false tags: [hyprland, nvidia] - name: Hyprland - configure early module loading in mkinitcpio replace: path: /etc/mkinitcpio.conf regexp: '^MODULES=\((.*)\)' replace: 'MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm \1)' when: mkinitcpio_check.rc != 0 notify: rebuild initramfs tags: [hyprland, nvidia] - name: Hyprland - register Wayland session desktop entry copy: dest: /usr/share/wayland-sessions/hyprland.desktop content: | [Desktop Entry] Name=Hyprland Comment=An intelligent dynamic tiling Wayland compositor Exec=Hyprland Type=Application DesktopNames=Hyprland tags: [hyprland, session] - name: Hyprland - template core configuration template: src: "{{ item.src }}" dest: "/home/{{ system_user }}/.config/{{ item.dest }}" owner: "{{ system_user }}" group: "{{ system_user }}" mode: '0644' loop: - { src: 'hyprland.conf.j2', dest: 'hypr/hyprland.conf' } - { src: 'hyprlock.conf.j2', dest: 'hypr/hyprlock.conf' } - { src: 'hypridle.conf.j2', dest: 'hypr/hypridle.conf' } - { src: 'hyprpaper.conf.j2', dest: 'hypr/hyprpaper.conf' } - { src: 'waybar_config.j2', dest: 'waybar/config' } - { src: 'waybar_style.css.j2', dest: 'waybar/style.css' } - { src: 'dunstrc.j2', dest: 'dunst/dunstrc' } tags: [hyprland, config]