Merge remote-tracking branch 'origin/master' into nix

This commit is contained in:
Geoffrey Frogeye 2023-11-02 19:55:47 +01:00
commit 634a0b7784
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
9 changed files with 108 additions and 105 deletions

View file

@ -1,3 +1,4 @@
---
- name: Default - name: Default
hosts: all hosts: all
roles: roles:

View file

@ -1,14 +1,11 @@
- name: xrdb-reload ---
command: "xrdb -I{{ ansible_env.HOME }} {{ ansible_env.HOME }}/.config/Xresources/main" - name: Xrdb-reload
ansible.builtin.command: xrdb -I{{ ansible_env.HOME }} {{ ansible_env.HOME }}/.config/Xresources/main
- name: i3-reload - name: I3-reload
command: i3-msg reload ansible.builtin.command: i3-msg reload
- name: Shell-reload
- name: shell-reload ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply"
command: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply" - name: Fzf-reload
ansible.builtin.command: source {{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf
- name: fzf-reload - name: Qutebrowser-reload
shell: "source {{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf" ansible.builtin.shell: "! pgrep qutebrowser || qutebrowser :config-source"
- name: qutebrowser-reload
shell: "! pgrep qutebrowser || qutebrowser :config-source"

View file

@ -1,22 +1,24 @@
---
- name: Ensure directories for desktop applications are present - name: Ensure directories for desktop applications are present
file: ansible.builtin.file:
state: directory state: directory
path: "{{ ansible_user_dir }}/{{ item }}" path: "{{ ansible_user_dir }}/{{ item }}"
mode: "u=rwx,g=rx,o=rx" mode: u=rwx,g=rx,o=rx
with_items: with_items:
- ".config/Xresources" - .config/Xresources
- ".config/rofi" - .config/rofi
- ".local/bin" - .local/bin
- ".local/share/fonts" - .local/share/fonts
- ".config/qutebrowser" - .config/qutebrowser
- ".config/tridactyl/themes" - .config/tridactyl/themes
# Download fonts # Download fonts
- name: Download Nerd fonts - name: Download Nerd fonts
get_url: ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/DejaVuSansMono/{{ item.folder }}/complete/{{ item.filename | urlencode }}" url: https://raw.githubusercontent.com/ryanoasis/nerd-fonts/704336735f576781b2a57b12a0c723e3316cbdec/patched-fonts/DejaVuSansMono/{{ item.folder }}/complete/{{
item.filename | urlencode }}
dest: "{{ ansible_user_dir }}/.local/share/fonts/{{ item.filename }}" dest: "{{ ansible_user_dir }}/.local/share/fonts/{{ item.filename }}"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
loop: loop:
- filename: DejaVu Sans Mono Bold Nerd Font Complete Mono.ttf - filename: DejaVu Sans Mono Bold Nerd Font Complete Mono.ttf
folder: Bold folder: Bold
@ -28,15 +30,16 @@
folder: Italic folder: Italic
- name: Download icon fonts - name: Download icon fonts
get_url: ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/FortAwesome/Font-Awesome/a8386aae19e200ddb0f6845b5feeee5eb7013687/fonts/fontawesome-webfont.ttf" url: https://raw.githubusercontent.com/FortAwesome/Font-Awesome/a8386aae19e200ddb0f6845b5feeee5eb7013687/fonts/fontawesome-webfont.ttf
dest: "{{ ansible_user_dir }}/.local/share/fonts/fontawesome-webfont.ttf" dest: "{{ ansible_user_dir }}/.local/share/fonts/fontawesome-webfont.ttf"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
# TODO Either replace with ForkAwesome or Nerd Fonts # TODO Either replace with ForkAwesome or Nerd Fonts
- name: Install python dependencies for lemonbar - name: Install python dependencies for lemonbar
pip: ansible.builtin.pip:
requirements: "{{ ansible_user_dir }}/.dotfiles/config/lemonbar/requirements.txt" requirements: "{{ ansible_user_dir }}/.dotfiles/config/lemonbar/requirements.txt"
extra_args: --break-system-packages # It's fine, it's local anyways
# Build a single color scheme and template and assign it to a variable # Build a single color scheme and template and assign it to a variable
- base16_builder: - base16_builder:
@ -58,20 +61,20 @@
- i3 - i3
- name: Configure Alacritty - name: Configure Alacritty
template: ansible.builtin.template:
src: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml.j2" src: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml.j2"
dest: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml" dest: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
# Alacritty has live config reload, so no command to execute # Alacritty has live config reload, so no command to execute
# However, it doesn't work with yaml includes, hence the template # However, it doesn't work with yaml includes, hence the template
tags: tags:
- color - color
- name: Set base16 theme for Xresources - name: Set base16 theme for Xresources
copy: ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['xresources']['xresources']['base16-' + base16_scheme + '-256.Xresources'] }}" content: "{{ base16_schemes['schemes'][base16_scheme]['xresources']['xresources']['base16-' + base16_scheme + '-256.Xresources'] }}"
dest: "{{ ansible_env.HOME }}/.config/Xresources/theme" dest: "{{ ansible_env.HOME }}/.config/Xresources/theme"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
notify: notify:
- xrdb-reload - xrdb-reload
tags: tags:
@ -79,30 +82,30 @@
when: display_server == 'x11' when: display_server == 'x11'
- name: Download base16 theme for qutebrowser - name: Download base16 theme for qutebrowser
copy: ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['qutebrowser']['themes/minimal']['base16-' + base16_scheme + '.config.py'] }}" content: "{{ base16_schemes['schemes'][base16_scheme]['qutebrowser']['themes/minimal']['base16-' + base16_scheme + '.config.py'] }}"
dest: "{{ ansible_env.HOME }}/.config/qutebrowser/theme.py" dest: "{{ ansible_env.HOME }}/.config/qutebrowser/theme.py"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
notify: notify:
- qutebrowser-reload - qutebrowser-reload
tags: tags:
- color - color
- name: Download base16 theme for Tridactyl - name: Download base16 theme for Tridactyl
copy: ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['tridactyl']['base16-' + base16_scheme + '.config.py'] }}" content: "{{ base16_schemes['schemes'][base16_scheme]['tridactyl']['base16-' + base16_scheme + '.config.py'] }}"
# url: "https://raw.githubusercontent.com/bezmi/base16-tridactyl/master/base16-{{ base16_scheme }}.css" # url: "https://raw.githubusercontent.com/bezmi/base16-tridactyl/master/base16-{{ base16_scheme }}.css"
dest: "{{ ansible_env.HOME }}/.config/tridactyl/themes/theme.css" dest: "{{ ansible_env.HOME }}/.config/tridactyl/themes/theme.css"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
when: False # Not currently used when: false # Not currently used
tags: tags:
- color - color
- name: Configure i3 - name: Configure i3
template: ansible.builtin.template:
src: "{{ ansible_env.HOME }}/.config/i3/config.j2" src: "{{ ansible_env.HOME }}/.config/i3/config.j2"
dest: "{{ ansible_env.HOME }}/.config/i3/config" dest: "{{ ansible_env.HOME }}/.config/i3/config"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
notify: notify:
- i3-reload - i3-reload
tags: tags:
@ -111,10 +114,10 @@
when: display_server == 'x11' when: display_server == 'x11'
- name: Set base16 theme for rofi - name: Set base16 theme for rofi
copy: ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['rofi']['themes']['base16-' + base16_scheme + '.' + item] }}" content: "{{ base16_schemes['schemes'][base16_scheme]['rofi']['themes']['base16-' + base16_scheme + '.' + item] }}"
dest: "{{ ansible_env.HOME }}/.config/rofi/theme.{{ item }}" dest: "{{ ansible_env.HOME }}/.config/rofi/theme.{{ item }}"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
tags: tags:
- color - color
loop: loop:
@ -122,49 +125,49 @@
- rasi - rasi
- name: Configure Dunst - name: Configure Dunst
template: ansible.builtin.template:
src: "{{ ansible_env.HOME }}/.config/dunst/dunstrc.j2" src: "{{ ansible_env.HOME }}/.config/dunst/dunstrc.j2"
dest: "{{ ansible_env.HOME }}/.config/dunst/dunstrc" dest: "{{ ansible_env.HOME }}/.config/dunst/dunstrc"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
tags: tags:
- color - color
when: display_server == 'x11' when: display_server == 'x11'
- name: Download base16 theme for fzf - name: Download base16 theme for fzf
copy: ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['fzf']['bash']['base16-' + base16_scheme + '.config'] }}" content: "{{ base16_schemes['schemes'][base16_scheme]['fzf']['bash']['base16-' + base16_scheme + '.config'] }}"
dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf" dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
notify: notify:
- fzf-reload - fzf-reload
tags: tags:
- color - color
- name: Download base16 theme for shell - name: Download base16 theme for shell
copy: ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['shell']['script']['base16-' + base16_scheme + '.sh'] }}" content: "{{ base16_schemes['schemes'][base16_scheme]['shell']['script']['base16-' + base16_scheme + '.sh'] }}"
dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply" dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply"
mode: "u=rwx,g=rx,o=rx" mode: u=rwx,g=rx,o=rx
notify: notify:
- shell-reload - shell-reload
when: False # Not currently used when: false # Not currently used
tags: tags:
- color - color
- name: Set used base16 theme for vim - name: Set used base16 theme for vim
copy: ansible.builtin.copy:
path: "{{ ansible_env.HOME }}/.config/vim/colorscheme.vim" path: "{{ ansible_env.HOME }}/.config/vim/colorscheme.vim"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
content: "colorscheme base16-{{ base16_scheme }}" content: colorscheme base16-{{ base16_scheme }}
when: False # Not currently used when: false # Not currently used
tags: tags:
- color - color
- name: Enable user services - name: Enable user services
systemd: ansible.builtin.systemd:
name: "{{ item }}" name: "{{ item }}"
state: started state: started
enabled: yes enabled: true
scope: user scope: user
loop: loop:
- pulseaudio - pulseaudio

View file

@ -1,3 +1,3 @@
- name: install dotfiles ---
command: "{{ ansible_user_dir }}/.dotfiles/config/scripts/dotfiles install" - name: Install dotfiles
# TODO A python module to do that, so without an handler ansible.builtin.command: "{{ ansible_user_dir }}/.dotfiles/config/scripts/dotfiles install"

View file

@ -1,25 +1,26 @@
---
- name: Ensure directories for applications are present - name: Ensure directories for applications are present
file: ansible.builtin.file:
state: directory state: directory
path: "{{ ansible_user_dir }}/{{ item }}" path: "{{ ansible_user_dir }}/{{ item }}"
mode: "u=rwx,g=rx,o=rx" mode: u=rwx,g=rx,o=rx
with_items: with_items:
- ".cache/zsh" - .cache/zsh
- ".cache/mpd" - .cache/mpd
- ".ssh" - .ssh
- ".local/bin" - .local/bin
- ".ansible/collections/ansible_collections/geoffreyfrogeye" - .ansible/collections/ansible_collections/geoffreyfrogeye
- name: Install dotfiles repository - name: Install dotfiles repository
git: ansible.builtin.git:
repo: "{% if has_forge_access %}git@git.frogeye.fr:{% else %}https://git.frogeye.fr/{% endif %}geoffrey/dotfiles.git" repo: "{% if has_forge_access %}git@git.frogeye.fr:{% else %}https://git.frogeye.fr/{% endif %}geoffrey/dotfiles.git"
dest: "{{ ansible_user_dir }}/.dotfiles" dest: "{{ ansible_user_dir }}/.dotfiles"
update: yes update: true
notify: install dotfiles notify: install dotfiles
tags: dotfiles_repo tags: dotfiles_repo
# TODO Put actual dotfiles in a subdirectory of the repo, so we don't have to put everything in config # TODO Put actual dotfiles in a subdirectory of the repo, so we don't have to put everything in config
- name: Install python dependencies for scripts - name: Install python dependencies for scripts
pip: ansible.builtin.pip:
requirements: "{{ ansible_user_dir }}/.dotfiles/config/scripts/requirements.txt" requirements: "{{ ansible_user_dir }}/.dotfiles/config/scripts/requirements.txt"
extra_args: --break-system-packages # It's fine, it's local anyways

View file

@ -1,13 +1,14 @@
---
- name: Load extensions - name: Load extensions
include_role: ansible.builtin.include_role:
name: "geoffreyfrogeye.{{ extension }}automatrop.entry" name: geoffreyfrogeye.{{ extension }}automatrop.entry
loop: "{{ extensions }}" loop: "{{ extensions }}"
loop_control: loop_control:
loop_var: extension loop_var: extension
tags: always tags: always
- name: Configure extensions rc sourcing - name: Configure extensions rc sourcing
template: ansible.builtin.template:
src: extrc.sh.j2 src: extrc.sh.j2
dest: "{{ ansible_user_dir }}/.config/shell/extrc" dest: "{{ ansible_user_dir }}/.config/shell/extrc"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r

View file

@ -1,11 +1,10 @@
- name: Reload systemd daemon - name: Reload systemd daemon
systemd: ansible.builtin.systemd:
daemon_reload: yes daemon_reload: true
listen: systemd changed listen: systemd changed
become: yes become: true
- name: Warn about changed Panfrost config - name: Warn about changed Panfrost config
debug: ansible.builtin.debug:
msg: "The Panfrost display driver configuration was changed, but needs a reboot to be applied." msg: The Panfrost display driver configuration was changed, but needs a reboot to be applied.
listen: panfrost config changed listen: panfrost config changed

View file

@ -1,49 +1,49 @@
# Xorg configuration # Xorg configuration
- name: Check if there is Intel backlight - name: Check if there is Intel backlight
stat: ansible.builtin.stat:
path: /sys/class/backlight/intel_backlight path: /sys/class/backlight/intel_backlight
register: intel_backlight register: intel_backlight
when: display_server == 'x11' when: display_server == 'x11'
- name: Install Intel video drivers (Arch based) - name: Install Intel video drivers (Arch based)
pacman: community.general.pacman:
name: xf86-video-intel name: xf86-video-intel
# state: "{{ intel_backlight.stat.exists }}" # state: "{{ intel_backlight.stat.exists }}"
state: present state: present
become: yes become: true
when: display_server == 'x11' and intel_backlight.stat.exists and arch_based when: display_server == 'x11' and intel_backlight.stat.exists and arch_based
# TODO With software role? Would permit other distributions # TODO With software role? Would permit other distributions
- name: Configure Xorg Intel backlight - name: Configure Xorg Intel backlight
copy: ansible.builtin.copy:
src: xorg/intel_backlight.conf src: xorg/intel_backlight.conf
dest: "{{ item }}/20-intel_backlight.conf" dest: "{{ item }}/20-intel_backlight.conf"
become: yes become: true
when: display_server == 'x11' and intel_backlight.stat.exists when: display_server == 'x11' and intel_backlight.stat.exists
loop: "{{ xorg_common_config_dirs }}" loop: "{{ xorg_common_config_dirs }}"
- name: Configure Xorg joystick behaviour - name: Configure Xorg joystick behaviour
copy: ansible.builtin.copy:
src: xorg/joystick.conf src: xorg/joystick.conf
dest: "{{ item }}/50-joystick.conf" dest: "{{ item }}/50-joystick.conf"
become: yes become: true
when: display_server == 'x11' when: display_server == 'x11'
loop: "{{ xorg_common_config_dirs }}" loop: "{{ xorg_common_config_dirs }}"
- name: List modules we're using - name: List modules we're using
slurp: ansible.builtin.slurp:
src: /proc/modules src: /proc/modules
register: modules register: modules
when: display_server when: display_server
# Not sure the module will be loaded in early setup stages though # Not sure the module will be loaded in early setup stages though
- name: Make panfrost use OpenGL 3.3 - name: Make panfrost use OpenGL 3.3
lineinfile: ansible.builtin.lineinfile:
path: /etc/environment path: /etc/environment
line: 'PAN_MESA_DEBUG="gl3"' line: PAN_MESA_DEBUG="gl3"
regexp: '^#? ?PAN_MESA_DEBUG=' regexp: ^#? ?PAN_MESA_DEBUG=
become: yes become: true
when: display_server and using_panfrost when: display_server and using_panfrost
vars: vars:
using_panfrost: "{{ 'panfrost' in (modules.content | b64decode) }}" using_panfrost: "{{ 'panfrost' in (modules.content | b64decode) }}"
@ -51,20 +51,20 @@
# Numlock on boot # Numlock on boot
- name: set numlock on boot - name: Set numlock on boot
copy: ansible.builtin.copy:
src: getty.service src: getty.service
dest: /etc/systemd/system/getty@.service.d/override.conf dest: /etc/systemd/system/getty@.service.d/override.conf
become: yes become: true
notify: notify:
- systemd changed - systemd changed
when: auto_numlock when: auto_numlock
- name: Unset numlock on boot - name: Unset numlock on boot
file: ansible.builtin.file:
path: /etc/systemd/system/getty@.service.d/override.conf path: /etc/systemd/system/getty@.service.d/override.conf
state: absent state: absent
become: yes become: true
notify: notify:
- systemd changed - systemd changed
when: not auto_numlock when: not auto_numlock

View file

@ -1,16 +1,17 @@
---
- name: Create Termux directory - name: Create Termux directory
file: ansible.builtin.file:
state: directory state: directory
path: "{{ ansible_user_dir }}/.termux" path: "{{ ansible_user_dir }}/.termux"
mode: "u=rwx,g=rx,o=rx" mode: u=rwx,g=rx,o=rx
# TODO This is a dotfiles directory. # TODO This is a dotfiles directory.
# Make it not install unless it's Termux # Make it not install unless it's Termux
- name: Silence Termux login message - name: Silence Termux login message
file: ansible.builtin.file:
state: file state: file
path: "{{ ansible_user_dir }}/.hushlogin" path: "{{ ansible_user_dir }}/.hushlogin"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
# Build a single color scheme and template and assign it to a variable # Build a single color scheme and template and assign it to a variable
- base16_builder: - base16_builder:
@ -22,10 +23,10 @@
- color - color
- name: Download base16 theme for Termux - name: Download base16 theme for Termux
copy: ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['termux']['colors']['base16-' + base16_scheme + '.properties'] }}" content: "{{ base16_schemes['schemes'][base16_scheme]['termux']['colors']['base16-' + base16_scheme + '.properties'] }}"
dest: "{{ ansible_env.HOME }}/.termux/colors.properties" dest: "{{ ansible_env.HOME }}/.termux/colors.properties"
mode: "u=rw,g=r,o=r" mode: u=rw,g=r,o=r
tags: tags:
- color - color