Compare commits

..

12 Commits

9 changed files with 138 additions and 60 deletions

View File

@@ -2,6 +2,7 @@ font_size_1: 12
font_size_2: 12
gpu: amd
cpu: amd
users:
- name: hannes

View File

@@ -2,6 +2,7 @@ font_size_1: 12
font_size_2: 12
gpu: nvidia
cpu: intel
users:
- name: hannes-work

View File

@@ -9,11 +9,12 @@ apps = yaml.safe_load(open(package_file, 'r'))
missing_config = {}
for appname, appconfig in apps['packages']['list'].items():
for appname, appconfig in apps.items():
for distro, packagelist in appconfig.items():
if len(packagelist) == 0:
if distro not in missing_config.keys():
missing_config[distro] = []
missing_config[distro].append(appname)
if missing_config:
print(yaml.dump(missing_config), end="")

26
drivers.yml Normal file
View File

@@ -0,0 +1,26 @@
cpu:
amd:
- amd-ucode
intel:
- intel-ucode
gpu:
amd:
- mesa
- lib32-mesa
- xf86-video-amdgpu
- vulkan-radeon
- lib32-vulkan-radeon
- libva-mesa-driver
- lib32-libva-mesa-driver
- mesa-vdpau
- lib32-mesa-vdpau
- vulkan-headers
- vulkan-tools
nvidia:
- mesa
- lib32-mesa
- vulkan-nouveau
- lib32-vulkan-nouveau
- vulkan-headers
- vulkan-tools

View File

@@ -458,6 +458,31 @@ tokei:
whois:
archlinux:
- whois # also contains mkpasswd
xxd:
encfs:
archlinux:
- tinyxxd
- encfs
digikam:
archlinux:
- digikam
evince:
archlinux:
- evince
iftop:
archlinux:
- iftop
inkscape:
archlinux:
- inkscape
android:
archlinux:
- android-tools
audacity:
archlinux:
- audacity
calibre:
archlinux:
- calibre
deluge:
archlinux:
- deluge
- deluge-gtk

View File

@@ -10,12 +10,6 @@
tags:
- always
- name: read variables
include_vars:
file: variables.yml
tags:
- always
- set_fact:
distro: "{{ ansible_distribution|lower }}"
tags:
@@ -173,7 +167,7 @@
state: present
become: true
vars:
query: "{{ 'list.*.%s[]'|format(distro) }}"
query: "{{ '*.%s[]'|format(distro) }}"
- name: remove unconfigured packages
script:
@@ -583,25 +577,48 @@
permit nopass nolog setenv {PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin} :sudonopw
become: true
- name: hardware-specific configuration
tags:
- hardware
block:
- name: read driver variables
include_vars:
file: drivers.yml
name: drivers
tags:
- always
- name: gpu configuration
tags:
- gpu
- hardware:gpu
block:
- name: install AMD cpu packages
package:
name: "{{ drivers.cpu.amd }}"
state: present
become: true
when: machine.cpu == 'amd'
- name: install Intel cpu packages
package:
name: "{{ drivers.cpu.intel }}"
state: present
become: true
when: machine.cpu == 'intel'
when:
- machine.cpu is defined
- name: gpu configuration
tags:
- hardware:gpu
block:
- name: AMD configuration
when: machine.gpu == 'amd'
block:
- name: install AMDGPU packages
package:
name:
- mesa
- lib32-mesa
- xf86-video-amdgpu
- vulkan-radeon
- lib32-vulkan-radeon
- libva-mesa-driver
- lib32-libva-mesa-driver
- mesa-vdpau
- lib32-mesa-vdpau
name: "{{ drivers.gpu.amd }}"
state: present
become: true
@@ -625,9 +642,7 @@
block:
- name: install nouveau packages
package:
name:
- mesa
- lib32-mesa
name: "{{ drivers.gpu.gpu }}"
state: present
become: true
when:

View File

@@ -1,13 +1,23 @@
#!/usr/bin/env bash
set -o nounset
set -o errexit
cpu="$(yaml2json < _machines/"$(hostname --short)".yml | jq --raw-output .cpu)"
gpu="$(yaml2json < _machines/"$(hostname --short)".yml | jq --raw-output .gpu)"
if [[ "${cpu}" ]] ; then
readarray -d $'\0' -t cpu_packages < <(<drivers.yml yaml2json | jq --raw-output0 ".cpu.${cpu}[]")
fi
if [[ "${gpu}" ]] ; then
readarray -d $'\0' -t gpu_packages < <(<drivers.yml yaml2json | jq --raw-output0 ".gpu.${gpu}[]")
fi
declare -a aurdeps=()
proctected=(
intel-ucode
amd-ucode
base
java-runtime-common
jdk17-openjdk
base # virtual package, would not hurt, but it's weird if its not installed
)
for pkgbuild in pkgbuilds/*/PKGBUILD ; do
@@ -15,12 +25,12 @@ for pkgbuild in pkgbuilds/*/PKGBUILD ; do
aurdeps+=("${depends[@]%%[<=>]*}" "${makedepends[@]%%[<=>]*}" "${pkgname}")
done
packages_to_remove=()
declare -a packages_to_remove=()
readarray -d $'\0' -t packages_to_remove < <(comm --zero-terminated -13 \
<(cat \
<(<packages.yml yaml2json | jq --raw-output0 'map(.archlinux) | flatten[]') \
<(for dep in "${aurdeps[@]}" ; do printf '%s\0' "${dep}" ; done) \
<(for dep in "${aurdeps[@]}" "${cpu_packages[@]}" "${gpu_packages[@]}" ; do printf '%s\0' "${dep}" ; done) \
| sort -zu) \
<(pacman -Qq --explicit | xargs -I "{}" printf '%s\0' "{}" | sort -zu) \
| while IFS= read -r -d $'\0' package; do
@@ -36,7 +46,7 @@ readarray -d $'\0' -t packages_to_remove < <(comm --zero-terminated -13 \
printf '%s\0' "${package}"
done)
if (( "${#packages_to_remove}" > 0 )) ; then
if (( "${#packages_to_remove[@]}" > 0 )) ; then
sudo pacman -Rcns "${packages_to_remove[@]}" "${@}" || exit $?
exit 123
fi

View File

@@ -53,7 +53,7 @@ set-option -g automatic-rename-format '#{pane_current_command}'
set-option -g window-status-separator ' '
set-option -g status-left " #[bg=#6c99bb,fg=#2e2e2e] #{session_name} #[bg=default] "
set-option -g status-right "#[bg=#CCCCCC,fg=#555555] #{host} #[bg=default] "
set-option -g status-right ""
set-option -g status-left-length 100
set-option -g message-style "bg=#CCCCCC,fg=#555555"

View File

@@ -1 +0,0 @@
portfolio_performace_version: "0.57.2"