Compare commits

...

3 Commits

Author SHA1 Message Date
Tom Alexander
38d255f0ab
Set up multiple sound server options for FreeBSD. 2024-05-18 09:52:18 -04:00
Tom Alexander
f44074ebe7
Only scrub when plugged in on Linux, and TCP optimization. 2024-05-16 21:20:30 -04:00
Tom Alexander
ee0fe7eca6
Use group root for /etc/localtime on Linux.
Arch Linux kept changing the group to root, so this change is to avoid unexpected "changed" entries in the ansible diff.
2024-05-12 23:23:09 -04:00
14 changed files with 129 additions and 42 deletions

View File

@ -15,6 +15,7 @@ pflog_conf:
- name: 0
dev: pflog0
cputype: "amd"
hwpstate: true
etc_hosts: {}
wireguard_directory: mrmanager
enabled_wireguard:

View File

@ -17,6 +17,7 @@ graphics_driver: "amd"
cputype: "amd"
hwpstate: true
cores: 16
sound_system: "oss"
users:
talexander:
initialize: true

View File

@ -29,15 +29,6 @@
- meld
state: present
- name: Set timezone
file:
src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}"
dest: /etc/localtime
owner: root
# TODO: Arch Linux is changing the group to root instead of wheel. Maybe make this a variable?
group: wheel
state: link
- name: Install scripts
copy:
src: "files/{{ item.src }}"

View File

@ -1,3 +1,11 @@
- name: Set timezone
file:
src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}"
dest: /etc/localtime
owner: root
group: wheel
state: link
- name: Install packages
package:
name:

View File

@ -1,3 +1,11 @@
- name: Set timezone
file:
src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}"
dest: /etc/localtime
owner: root
group: root
state: link
- name: Install packages
package:
name:
@ -18,17 +26,6 @@
daemon_reload: yes
enabled: yes
# Of questionable value since I don't use swap on my machines
- name: Configure sysctls for swap
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/swap.conf
loop:
- name: vm.swappiness
value: 10
- name: Install scripts
copy:
src: "files/{{ item.src }}"
@ -41,3 +38,31 @@
dest: /usr/local/bin/mount_disk_image
- src: watch_linux
dest: /usr/local/bin/ww
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/{{ item.file }}
loop:
# Of questionable value since I don't use swap on my machines
- name: vm.swappiness
value: 10
file: swap.conf
# Enable TCP packetization-layer PMTUD when an ICMP black hole is detected.
- name: net.ipv4.tcp_mtu_probing
value: 1
file: tcp.conf
# Switch to bbr tcp congestion control which should be better on lossy connections like bad wifi.
- name: net.ipv4.tcp_congestion_control
value: bbr
file: tcp.conf
# Don't do a slow start after a connection has been idle for a single RTO.
- name: net.ipv4.tcp_slow_start_after_idle
value: 0
file: tcp.conf
# 3x time to accumulate filesystem changes before flushing to disk.
- name: vm.dirty_writeback_centisecs
value: 1500
file: power.conf

View File

@ -5,7 +5,6 @@
CPUTYPE?=x86-64-v4
.elif ${.CURDIR:N*/lang/gcc48*} && ${.CURDIR:N*/lang/gcc10*} && ${.CURDIR:N*/devel/binutils*} && ${.CURDIR:N*/devel/qt6-base*} && ${.CURDIR:N*/www/node20*}
CPUTYPE?=znver4
# CPUTYPE?=x86-64-v4
.endif
# Disable static for subversion because /usr/local/lib/libutf8proc.a not found despite utf8proc being installed
@ -26,7 +25,8 @@ OPTIONS_SET+=NATIVECOMP PGTK
.endif
.if ${.CURDIR:M*/www/firefox*}
OPTIONS_UNSET+=PULSEAUDIO SNDIO JACK
OPTIONS_UNSET+=PULSEAUDIO SNDIO
OPTIONS_UNSET+=JACK
.endif
OPTIONS_SET+=OPTIMIZED_CFLAGS

View File

@ -1,11 +1,7 @@
archivers/unrar
archivers/unzip
archivers/zip
audio/jack
audio/mixertui
audio/noise-suppression-for-voice-lv2
audio/pavucontrol
audio/qjackctl
databases/sqlite3
deskutils/xdg-desktop-portal
devel/git

View File

@ -1,4 +1,4 @@
# Check that rust-analyzer is valid for date on https://rust-lang.github.io/rustup-components-history/
rust_date: "2024-04-29"
rust_date: "2024-05-06"
# rust_analyzer_version: 2024-04-29
rust_analyzer_version: package

View File

@ -4,13 +4,6 @@
- mixertui
state: present
- name: Install packages
when: install_graphics
package:
name:
- pavucontrol
state: present
- name: Configure sysctls
ignore_errors: true
when: sound_default_unit is defined
@ -25,12 +18,15 @@
- name: hw.snd.default_unit
value: "{{ sound_default_unit }}"
- name: Install loader.conf
copy:
src: "files/{{ item }}_loader.conf"
dest: "/boot/loader.conf.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: "/etc/sysctl.conf.local"
loop:
- realtime_priority
- name: hw.snd.verbose
value: "2"
- include_tasks: "tasks/freebsd_{{sound_system}}.yaml"
when: sound_system is defined

View File

@ -0,0 +1,37 @@
# Jack users must be added to the realtime group.
# Also set memorylocked to 128M in login.conf
# D-bus should be enabled for auto-launching jack.
- name: Install loader.conf
copy:
src: "files/{{ item }}_loader.conf"
dest: "/boot/loader.conf.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
loop:
- realtime_priority
- name: Install packages
package:
name:
- jackit
state: present
- name: Install packages
when: install_graphics
package:
name:
- qjackctl
state: present
# hw.snd.default_auto=0 # (2)
# hw.snd.default_unit=1 # (3)
# hw.usb.uaudio.buffer_ms="2"
# hw.snd.latency=0
# hw.snd.latency_profile=0
# Hurts battery:
# kern.timecounter.alloweddeviation=0

View File

@ -0,0 +1,7 @@
- name: Install packages
when: install_graphics
package:
name:
- pavucontrol
state: present

View File

@ -0,0 +1,2 @@
[Unit]
ConditionACPower=true

View File

@ -61,3 +61,26 @@
name: "zfs-scrub-weekly@{{ item }}.timer"
daemon_reload: yes
loop: "{{ periodic_scrub_pools }}"
- name: Create directories
when: periodic_scrub_pools is defined
file:
name: "{{ item }}"
state: directory
mode: 0755
owner: root
group: wheel # Normally it is "root"
loop:
- /etc/systemd/system/zfs-scrub-weekly@.timer.d
- name: Install Configuration
when: periodic_scrub_pools is defined
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel # Normally it is "root"
loop:
- src: linux_scrub_when_plugged_in.conf
dest: /etc/systemd/system/zfs-scrub-weekly@.timer.d/override.conf