Minimal i3 setup

This commit is contained in:
Fabio Scotto di Santolo
2026-03-15 22:00:35 +01:00
parent 6e0f5eb83b
commit 34276c2de1
33 changed files with 1034 additions and 52 deletions

View File

@@ -1,5 +0,0 @@
[defaults]
inventory = inventory/hosts.yml
roles_path = roles
host_key_checking = False
retry_files_enabled = False

View File

@@ -1 +1,15 @@
# common variables
---
ansible_python_interpreter: /usr/bin/python3
username: fscotto
user_group: fscotto
user_home: "/home/{{ username }}"
user_shell: /bin/bash
common_packages:
- bash-completion
- git
- wget
- unzip
- zip
- vim
- fzf

View File

@@ -1 +1,30 @@
# desktop profile variables
---
profile_packages:
- i3
- i3blocks
- i3blocks-blocklets
- i3status
- i3lock-color
- dunst
- rofi
- alacritty
- Thunar
- thunar-volman
- udiskie
- xfce-polkit
- xfce4-power-manager
- xfce4-clipman-plugin
- xfce4-screenshooter
- volumeicon
- brightnessctl
- feh
- scrot
- xclip
- network-manager-applet
- chromium
- mpv
- libreoffice
- lm_sensors
- fastfetch
- liberation-fonts-ttf
- terminus-font

View File

@@ -1 +1,27 @@
# variables for Void Linux hosts
---
void_packages_base:
- base-system
- xtools
- vpm
- vsv
- xorg-minimal
- xorg-fonts
- elogind
- NetworkManager
- xdg-desktop-portal
- xdg-desktop-portal-gtk
- flatpak
- gvfs
- pipewire
- pavucontrol
- gnome-keyring
- seahorse
- socklog
- socklog-void
enabled_services:
- dbus
- elogind
- NetworkManager
- socklog-unix
- nanoklogd

View File

@@ -1 +1,11 @@
# ikaros specific variables
---
hostname: ikaros
host_packages:
- void-repo-nonfree
- nvidia
- mesa-dri
- mesa-vaapi
- mesa-vdpau
host_enabled_services: []

View File

@@ -1 +1,11 @@
# nymph specific variables
---
hostname: nymph
host_packages:
- tlp
- tlp-rdw
- blueman
- bluez
host_enabled_services:
- tlp

View File

@@ -4,21 +4,12 @@ all:
hosts:
ikaros:
nymph:
ansible_connection: local
ubuntu:
hosts:
deadalus:
prometheus:
desktop:
hosts:
ikaros:
nymph:
workstation:
ubuntu_workstation:
hosts:
deadalus:
server:
ubuntu_server:
hosts:
prometheus:

View File

@@ -1 +1,12 @@
# install packages with xbps
---
- name: Install packages on Void Linux
community.general.xbps:
name: >-
{{
(common_packages | default([]))
+ (void_packages_base | default([]))
+ (profile_packages | default([]))
+ (host_packages | default([]))
}}
state: present
update_cache: true

View File

@@ -1 +1,77 @@
# desktop profile tasks
---
- name: Ensure config directories exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0755"
loop:
- "{{ user_home }}/.config"
- "{{ user_home }}/.config/i3"
- "{{ user_home }}/.config/i3blocks"
- "{{ user_home }}/.config/dunst"
- "{{ user_home }}/.config/alacritty"
- "{{ user_home }}/.config/Thunar"
- name: Enable gnome-keyring PAM auth hook
ansible.builtin.lineinfile:
path: /etc/pam.d/login
insertafter: '^auth\s+include\s+system-local-login$'
line: 'auth optional pam_gnome_keyring.so'
state: present
- name: Enable gnome-keyring PAM session hook
ansible.builtin.lineinfile:
path: /etc/pam.d/login
insertafter: '^session\s+include\s+system-local-login$'
line: 'session optional pam_gnome_keyring.so auto_start'
state: present
- name: Copy i3 config
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/.config/i3/"
dest: "{{ user_home }}/.config/i3/"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: preserve
- name: Copy i3blocks config
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/.config/i3blocks/"
dest: "{{ user_home }}/.config/i3blocks/"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: preserve
- name: Copy dunst config
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/.config/dunst/"
dest: "{{ user_home }}/.config/dunst/"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: preserve
- name: Copy alacritty config
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/.config/alacritty/"
dest: "{{ user_home }}/.config/alacritty/"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: preserve
- name: Copy Thunar config
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/.config/Thunar/"
dest: "{{ user_home }}/.config/Thunar/"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: preserve
- name: Copy .xinitrc
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/.xinitrc"
dest: "{{ user_home }}/.xinitrc"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0644"

View File

@@ -1 +1,14 @@
# enable runit services
---
- name: Enable base runit services
ansible.builtin.file:
src: "/etc/sv/{{ item }}"
dest: "/var/service/{{ item }}"
state: link
loop: "{{ enabled_services | default([]) }}"
- name: Enable host runit services
ansible.builtin.file:
src: "/etc/sv/{{ item }}"
dest: "/var/service/{{ item }}"
state: link
loop: "{{ host_enabled_services | default([]) }}"

View File

@@ -1,31 +1,8 @@
---
- name: Converge all machines
hosts: all
- hosts: void
become: true
roles:
- base
- role: packages_void
when: "'void' in group_names"
- role: packages_ubuntu
when: "'ubuntu' in group_names"
- role: services_runit
when: "'void' in group_names"
- role: services_systemd
when: "'ubuntu' in group_names"
- role: profile_desktop_i3
when: "'desktop' in group_names"
- role: profile_workstation_gnome
when: "'workstation' in group_names"
- role: profile_server
when: "'server' in group_names"
- role: dotfiles
become: false
- packages_void
- services_runit
- profile_desktop_i3