Switch to Linux Mint and FreeBSD

This commit is contained in:
Fabio Scotto di Santolo
2026-07-11 22:04:22 +02:00
parent 826f502af0
commit f33f3fe433
26 changed files with 804 additions and 87 deletions

View File

@@ -0,0 +1,29 @@
---
- name: Install packages on FreeBSD
tags: [packages]
community.general.pkgng:
name: >-
{{
(
(freebsd_packages_base | default([]))
+ (freebsd_development_packages | default([]))
+ (
(freebsd_desktop_common_packages | default([]))
if 'graphical_desktop' in group_names
else []
)
+ (
(freebsd_hyprland_packages | default([]))
if 'desktop_hyprland' in group_names
else []
)
+ (
(freebsd_lab_packages | default([]))
if 'role_lab' in group_names
else []
)
+ (host_packages | default([]))
)
| unique
}}
state: present

View File

@@ -0,0 +1,80 @@
---
- name: Refresh apt package cache on Linux Mint
tags: [packages]
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
- name: Install packages on Linux Mint
tags: [packages]
ansible.builtin.apt:
name: >-
{{
(
(common_packages | default([]))
+ (mint_packages_base | default([]))
+ (mint_development_packages | default([]))
+ (
(mint_desktop_common_packages | default([]))
if 'graphical_desktop' in group_names
else []
)
+ (
(mint_cinnamon_packages | default([]))
if 'desktop_cinnamon' in group_names
else []
)
+ (
(mint_personal_workstation_packages | default([]))
if 'role_personal_workstation' in group_names
else []
)
+ (host_packages | default([]))
)
| unique
}}
state: present
- name: Ensure Flathub remote is configured on Linux Mint
tags: [packages]
community.general.flatpak_remote:
name: "{{ mint_flatpak_remote_name | default('flathub') }}"
state: present
flatpakrepo_url: "{{ mint_flatpak_remote_url | default('https://dl.flathub.org/repo/flathub.flatpakrepo') }}"
when:
- mint_manage_flatpak | default(true)
- >-
(
(mint_flatpak_packages | default([]))
+ (personal_workstation_flatpak_packages | default([]))
) | length > 0
- name: Install Linux Mint Flatpak applications
tags: [packages]
community.general.flatpak:
name: >-
{{
(
(mint_flatpak_packages | default([]))
+ (
(personal_workstation_flatpak_packages | default([]))
if 'role_personal_workstation' in group_names
else []
)
)
| unique
}}
state: present
remote: "{{ mint_flatpak_remote_name | default('flathub') }}"
method: system
when:
- mint_manage_flatpak | default(true)
- >-
(
(mint_flatpak_packages | default([]))
+ (
(personal_workstation_flatpak_packages | default([]))
if 'role_personal_workstation' in group_names
else []
)
) | length > 0

View File

@@ -0,0 +1,27 @@
---
- name: Ensure Cinnamon user config directories exist
tags: [dotfiles, dotfiles:desktop, cinnamon]
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0755"
loop:
- "{{ user_home }}/.config"
- "{{ user_home }}/.local"
- "{{ user_home }}/.local/share"
- name: Apply Cinnamon dconf settings
tags: [cinnamon]
community.general.dconf:
key: "{{ item.key }}"
value: "{{ item.value }}"
state: present
become: true
become_user: "{{ username }}"
environment:
HOME: "{{ user_home }}"
loop: "{{ cinnamon_dconf_settings | default([]) }}"
loop_control:
label: "{{ item.key }}"

View File

@@ -0,0 +1,4 @@
[preferred]
default=gtk
org.freedesktop.impl.portal.Screenshot=hyprland
org.freedesktop.impl.portal.ScreenCast=hyprland

View File

@@ -0,0 +1,58 @@
---
- name: Ensure FreeBSD Hyprland user config directories exist
tags: [dotfiles, dotfiles:desktop, hyprland]
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0755"
loop:
- "{{ user_home }}/.config"
- "{{ user_home }}/.config/alacritty"
- "{{ user_home }}/.config/dunst"
- "{{ user_home }}/.config/foot"
- "{{ user_home }}/.config/hypr"
- "{{ user_home }}/.config/rofi"
- "{{ user_home }}/.config/waybar"
- "{{ user_home }}/.local"
- "{{ user_home }}/.local/bin"
- name: Copy common Hyprland desktop dotfiles on FreeBSD
tags: [dotfiles, dotfiles:desktop, hyprland]
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/{{ item.src }}"
dest: "{{ user_home }}/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ desktop_hyprland_dotfiles | default([]) }}"
loop_control:
label: "{{ item.dest }}"
- name: Render FreeBSD Hyprland session launcher
tags: [packages, services, hyprland]
ansible.builtin.template:
src: start-hyprland-session.j2
dest: /usr/local/bin/start-hyprland-session
owner: root
group: wheel
mode: "0755"
- name: Ensure FreeBSD xdg-desktop-portal config directory exists
tags: [packages, services, hyprland, portal]
ansible.builtin.file:
path: "{{ freebsd_xdg_config_dir | default('/usr/local/etc/xdg') }}/xdg-desktop-portal"
state: directory
owner: root
group: wheel
mode: "0755"
- name: Configure xdg-desktop-portal backend preferences for FreeBSD Hyprland
tags: [packages, services, hyprland, portal]
ansible.builtin.copy:
src: hyprland-portals.conf
dest: "{{ freebsd_xdg_config_dir | default('/usr/local/etc/xdg') }}/xdg-desktop-portal/hyprland-portals.conf"
owner: root
group: wheel
mode: "0644"

View File

@@ -0,0 +1,24 @@
#!/bin/sh
[ -r /etc/profile ] && . /etc/profile
[ -r "$HOME/.profile" ] && . "$HOME/.profile"
export XDG_CURRENT_DESKTOP=Hyprland
export XDG_SESSION_DESKTOP=Hyprland
export XDG_SESSION_TYPE=wayland
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM='wayland;xcb'
export _JAVA_AWT_WM_NONREPARENTING=1
export SDL_VIDEODRIVER=wayland
export GDK_BACKEND='wayland,x11'
export SSH_AUTH_SOCK="$HOME/.local/state/ssh-agent/socket"
[ -r "$HOME/.config/hypr/session-env" ] && . "$HOME/.config/hypr/session-env"
if command -v dbus-run-session >/dev/null 2>&1; then
exec dbus-run-session Hyprland
fi
exec Hyprland

View File

@@ -0,0 +1,12 @@
---
- name: Ensure lab workspace directories exist
tags: [dotfiles]
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ lab_workspace_directories | default([]) }}"
loop_control:
label: "{{ item.path }}"

View File

@@ -0,0 +1,24 @@
---
- name: Ensure personal workstation directories exist
tags: [dotfiles, dotfiles:workstation]
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ personal_workstation_directories | default([]) }}"
loop_control:
label: "{{ item.path }}"
- name: Copy personal workstation dotfiles
tags: [dotfiles, dotfiles:workstation]
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/workstation/{{ item.src }}"
dest: "{{ user_home }}/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ personal_workstation_dotfiles | default([]) }}"
loop_control:
label: "{{ item.dest }}"

View File

@@ -0,0 +1,20 @@
---
- name: Configure FreeBSD rc.conf values
tags: [services, packages]
community.general.sysrc:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
loop: "{{ freebsd_rc_conf | default([]) }}"
loop_control:
label: "{{ item.name }}"
- name: Enable FreeBSD rc services
tags: [services, packages]
ansible.builtin.service:
name: "{{ item }}"
enabled: true
state: started
loop: "{{ freebsd_enabled_services | default([]) + host_enabled_services | default([]) }}"
loop_control:
label: "{{ item }}"

View File

@@ -18,4 +18,3 @@
loop: "{{ host_enabled_services | default([]) }}"
loop_control:
label: "{{ item }}"