Compare commits
12 Commits
b619694f1f
...
05ac37d172
| Author | SHA1 | Date | |
|---|---|---|---|
| 05ac37d172 | |||
| 7ae2c59ba4 | |||
| fb781a5b5d | |||
| 0b8a26742a | |||
| b272f5fd3a | |||
| 828b38ec0f | |||
| 2678e2adfe | |||
| d25dba89bb | |||
| 688637b3e3 | |||
| a6fec3c344 | |||
| 7af17b46da | |||
| caaa397332 |
@@ -2,6 +2,7 @@ font_size_1: 12
|
|||||||
font_size_2: 12
|
font_size_2: 12
|
||||||
|
|
||||||
gpu: amd
|
gpu: amd
|
||||||
|
cpu: amd
|
||||||
|
|
||||||
users:
|
users:
|
||||||
- name: hannes
|
- name: hannes
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ font_size_1: 12
|
|||||||
font_size_2: 12
|
font_size_2: 12
|
||||||
|
|
||||||
gpu: nvidia
|
gpu: nvidia
|
||||||
|
cpu: intel
|
||||||
|
|
||||||
users:
|
users:
|
||||||
- name: hannes-work
|
- name: hannes-work
|
||||||
|
|||||||
@@ -9,11 +9,12 @@ apps = yaml.safe_load(open(package_file, 'r'))
|
|||||||
|
|
||||||
missing_config = {}
|
missing_config = {}
|
||||||
|
|
||||||
for appname, appconfig in apps['packages']['list'].items():
|
for appname, appconfig in apps.items():
|
||||||
for distro, packagelist in appconfig.items():
|
for distro, packagelist in appconfig.items():
|
||||||
if len(packagelist) == 0:
|
if len(packagelist) == 0:
|
||||||
if distro not in missing_config.keys():
|
if distro not in missing_config.keys():
|
||||||
missing_config[distro] = []
|
missing_config[distro] = []
|
||||||
missing_config[distro].append(appname)
|
missing_config[distro].append(appname)
|
||||||
|
|
||||||
|
if missing_config:
|
||||||
print(yaml.dump(missing_config), end="")
|
print(yaml.dump(missing_config), end="")
|
||||||
|
|||||||
26
drivers.yml
Normal file
26
drivers.yml
Normal 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
|
||||||
29
packages.yml
29
packages.yml
@@ -458,6 +458,31 @@ tokei:
|
|||||||
whois:
|
whois:
|
||||||
archlinux:
|
archlinux:
|
||||||
- whois # also contains mkpasswd
|
- whois # also contains mkpasswd
|
||||||
xxd:
|
encfs:
|
||||||
archlinux:
|
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
|
||||||
|
|||||||
57
playbook.yml
57
playbook.yml
@@ -10,12 +10,6 @@
|
|||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
- name: read variables
|
|
||||||
include_vars:
|
|
||||||
file: variables.yml
|
|
||||||
tags:
|
|
||||||
- always
|
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
distro: "{{ ansible_distribution|lower }}"
|
distro: "{{ ansible_distribution|lower }}"
|
||||||
tags:
|
tags:
|
||||||
@@ -173,7 +167,7 @@
|
|||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
vars:
|
vars:
|
||||||
query: "{{ 'list.*.%s[]'|format(distro) }}"
|
query: "{{ '*.%s[]'|format(distro) }}"
|
||||||
|
|
||||||
- name: remove unconfigured packages
|
- name: remove unconfigured packages
|
||||||
script:
|
script:
|
||||||
@@ -583,25 +577,48 @@
|
|||||||
permit nopass nolog setenv {PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin} :sudonopw
|
permit nopass nolog setenv {PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin} :sudonopw
|
||||||
become: true
|
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
|
- name: gpu configuration
|
||||||
tags:
|
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:
|
block:
|
||||||
- name: AMD configuration
|
- name: AMD configuration
|
||||||
when: machine.gpu == 'amd'
|
when: machine.gpu == 'amd'
|
||||||
block:
|
block:
|
||||||
- name: install AMDGPU packages
|
- name: install AMDGPU packages
|
||||||
package:
|
package:
|
||||||
name:
|
name: "{{ drivers.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
|
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
@@ -625,9 +642,7 @@
|
|||||||
block:
|
block:
|
||||||
- name: install nouveau packages
|
- name: install nouveau packages
|
||||||
package:
|
package:
|
||||||
name:
|
name: "{{ drivers.gpu.gpu }}"
|
||||||
- mesa
|
|
||||||
- lib32-mesa
|
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
when:
|
when:
|
||||||
|
|||||||
@@ -1,13 +1,23 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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=()
|
declare -a aurdeps=()
|
||||||
|
|
||||||
proctected=(
|
proctected=(
|
||||||
intel-ucode
|
base # virtual package, would not hurt, but it's weird if its not installed
|
||||||
amd-ucode
|
|
||||||
base
|
|
||||||
java-runtime-common
|
|
||||||
jdk17-openjdk
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for pkgbuild in pkgbuilds/*/PKGBUILD ; do
|
for pkgbuild in pkgbuilds/*/PKGBUILD ; do
|
||||||
@@ -15,12 +25,12 @@ for pkgbuild in pkgbuilds/*/PKGBUILD ; do
|
|||||||
aurdeps+=("${depends[@]%%[<=>]*}" "${makedepends[@]%%[<=>]*}" "${pkgname}")
|
aurdeps+=("${depends[@]%%[<=>]*}" "${makedepends[@]%%[<=>]*}" "${pkgname}")
|
||||||
done
|
done
|
||||||
|
|
||||||
packages_to_remove=()
|
declare -a packages_to_remove=()
|
||||||
|
|
||||||
readarray -d $'\0' -t packages_to_remove < <(comm --zero-terminated -13 \
|
readarray -d $'\0' -t packages_to_remove < <(comm --zero-terminated -13 \
|
||||||
<(cat \
|
<(cat \
|
||||||
<(<packages.yml yaml2json | jq --raw-output0 'map(.archlinux) | flatten[]') \
|
<(<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) \
|
| sort -zu) \
|
||||||
<(pacman -Qq --explicit | xargs -I "{}" printf '%s\0' "{}" | sort -zu) \
|
<(pacman -Qq --explicit | xargs -I "{}" printf '%s\0' "{}" | sort -zu) \
|
||||||
| while IFS= read -r -d $'\0' package; do
|
| 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}"
|
printf '%s\0' "${package}"
|
||||||
done)
|
done)
|
||||||
|
|
||||||
if (( "${#packages_to_remove}" > 0 )) ; then
|
if (( "${#packages_to_remove[@]}" > 0 )) ; then
|
||||||
sudo pacman -Rcns "${packages_to_remove[@]}" "${@}" || exit $?
|
sudo pacman -Rcns "${packages_to_remove[@]}" "${@}" || exit $?
|
||||||
exit 123
|
exit 123
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ set-option -g automatic-rename-format '#{pane_current_command}'
|
|||||||
set-option -g window-status-separator ' '
|
set-option -g window-status-separator ' '
|
||||||
|
|
||||||
set-option -g status-left " #[bg=#6c99bb,fg=#2e2e2e] #{session_name} #[bg=default] "
|
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 status-left-length 100
|
||||||
|
|
||||||
set-option -g message-style "bg=#CCCCCC,fg=#555555"
|
set-option -g message-style "bg=#CCCCCC,fg=#555555"
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
portfolio_performace_version: "0.57.2"
|
|
||||||
Reference in New Issue
Block a user