Compare commits
24 Commits
a8d17796e6
...
5922d989e0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5922d989e0 | |||
| 07884738b8 | |||
| 0b237bd9bc | |||
| d53a3ab0c0 | |||
| 6bdc001e53 | |||
| 996a758670 | |||
| 1318431476 | |||
| db422d2cdb | |||
| a418654fb8 | |||
| f9757b58aa | |||
| 9cf05ac5fe | |||
| 206015074a | |||
| 0ee36e4373 | |||
| 143c41e100 | |||
| a71f756b2d | |||
| e9dfea94c3 | |||
| 2751beafc1 | |||
| fcaa7d40be | |||
| 7298ed104f | |||
| 1501d256b8 | |||
| f2cb3de845 | |||
| b8db8bbfb7 | |||
| 8e87be2ecf | |||
| 029d1f3e0a |
@@ -67,6 +67,5 @@ environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "true"
|
||||
MACHINE_HAS_STEAM: "true"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "false"
|
||||
MACHINE_HAS_ELEMENT: "true"
|
||||
MACHINE_RESOLUTION_X: "2560"
|
||||
MACHINE_RESOLUTION_Y: "1440"
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
font_size_1: 12
|
||||
font_size_2: 9
|
||||
|
||||
i3bar_icon_padding: ""
|
||||
|
||||
users:
|
||||
- name: hannes-work
|
||||
group: hannes-work
|
||||
vt: 1
|
||||
firefox_profiles:
|
||||
default:
|
||||
extensions:
|
||||
- ublock-origin
|
||||
- privacy-badger17
|
||||
- tree-style-tab
|
||||
- i-dont-care-about-cookies
|
||||
manage_css: true
|
||||
meet:
|
||||
extensions:
|
||||
- ublock-origin
|
||||
manage_css: false
|
||||
mail: hannes.koerber@tradebyte.com
|
||||
git_gpg_sign: false
|
||||
ssh_agent: true
|
||||
gpg_agent: false
|
||||
gpg_agent_for_ssh: false
|
||||
environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "false"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "true"
|
||||
MACHINE_HAS_ELEMENT: "false"
|
||||
MACHINE_HAS_KEEPASSX: "true"
|
||||
repositories: []
|
||||
- name: hannes-private
|
||||
group: hannes-private
|
||||
vt: 2
|
||||
firefox_profiles:
|
||||
default:
|
||||
extensions:
|
||||
- ublock-origin
|
||||
- passff
|
||||
- privacy-badger17
|
||||
- tree-style-tab
|
||||
- i-dont-care-about-cookies
|
||||
- floccus
|
||||
manage_css: true
|
||||
mail: hannes@hkoerber.de
|
||||
git_gpg_sign: false
|
||||
ssh_agent: false
|
||||
gpg_agent: true
|
||||
gpg_agent_for_ssh: true
|
||||
gpg_key:
|
||||
email: hannes@hkoerber.de
|
||||
id: "0xB5C002530C6A2053"
|
||||
fingerprint: "973AE48D71B76735C4712B5BB5C002530C6A2053"
|
||||
enable_passwordstore: true
|
||||
environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "true"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "false"
|
||||
MACHINE_HAS_ELEMENT: "true"
|
||||
MACHINE_HAS_KEEPASSX: "false"
|
||||
has_yubikey: true
|
||||
repositories:
|
||||
- personal_projects
|
||||
|
||||
screen:
|
||||
1: DP-1-1
|
||||
2: DP-1-1
|
||||
3: DP-1-2
|
||||
4: DP-1-2
|
||||
5: DP-1-2
|
||||
6: DP-1-2
|
||||
7: eDP-1
|
||||
8: eDP-1
|
||||
9: eDP-1
|
||||
0: eDP-1
|
||||
|
||||
workspace:
|
||||
1: ""
|
||||
2: ""
|
||||
3: " local"
|
||||
4: " remote"
|
||||
7: ""
|
||||
8: ""
|
||||
9: ""
|
||||
10: ""
|
||||
|
||||
screencfgs:
|
||||
- name: three-screens
|
||||
key: F3
|
||||
|
||||
environment:
|
||||
MACHINE_TYPE: "laptop"
|
||||
MACHINE_RESOLUTION_X: "1920"
|
||||
MACHINE_RESOLUTION_Y: "1080"
|
||||
@@ -1,5 +1,5 @@
|
||||
font_size_1: 12
|
||||
font_size_2: 9
|
||||
font_size_2: 12
|
||||
|
||||
i3bar_icon_padding: ""
|
||||
|
||||
@@ -19,20 +19,16 @@ users:
|
||||
extensions:
|
||||
- ublock-origin
|
||||
manage_css: false
|
||||
mail: hannes.koerber@tradebyte.com
|
||||
mail: h.koerber@clipmyhorse.tv
|
||||
git_gpg_sign: false
|
||||
ssh_agent: true
|
||||
gpg_agent: false
|
||||
gpg_agent_for_ssh: false
|
||||
environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "false"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "true"
|
||||
MACHINE_HAS_ELEMENT: "false"
|
||||
MACHINE_HAS_KEEPASSX: "true"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "false"
|
||||
MACHINE_HAS_KEEPASSX: "false"
|
||||
repositories: []
|
||||
overrides:
|
||||
terraform_version: 1.1.3
|
||||
terraform_check_updates: false
|
||||
|
||||
- name: hannes-private
|
||||
group: hannes-private
|
||||
@@ -60,7 +56,6 @@ users:
|
||||
environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "true"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "false"
|
||||
MACHINE_HAS_ELEMENT: "true"
|
||||
MACHINE_HAS_KEEPASSX: "false"
|
||||
repositories:
|
||||
- personal_projects
|
||||
@@ -84,7 +79,7 @@ workspace:
|
||||
4: " remote"
|
||||
7: ""
|
||||
8: ""
|
||||
9: ""
|
||||
9: ""
|
||||
10: ""
|
||||
|
||||
screencfgs:
|
||||
@@ -94,4 +89,4 @@ screencfgs:
|
||||
environment:
|
||||
MACHINE_TYPE: "laptop"
|
||||
MACHINE_RESOLUTION_X: "1920"
|
||||
MACHINE_RESOLUTION_Y: "1080"
|
||||
MACHINE_RESOLUTION_Y: "1200"
|
||||
|
||||
@@ -122,3 +122,5 @@
|
||||
defaultBranch = master
|
||||
[safe]
|
||||
directory = /var/lib/dotfiles
|
||||
[includeIf "gitdir:/var/lib/dotfiles"]
|
||||
path = /var/lib/dotfiles/gitcfg
|
||||
|
||||
3
gitcfg
Normal file
3
gitcfg
Normal file
@@ -0,0 +1,3 @@
|
||||
[user]
|
||||
email = hannes@hkoerber.de
|
||||
name = Hannes Körber
|
||||
@@ -34,12 +34,7 @@ fixed-list-mode
|
||||
no-mangle-dos-filenames
|
||||
require-cross-certification
|
||||
|
||||
{% if not (distro == 'ubuntu' and ansible_distribution_version == '18.04') -%}
|
||||
{# looks like the gpg version in that ubuntu release it too old and does not
|
||||
{# contain the setting #}
|
||||
# do not cache keys for symmetric encryption
|
||||
no-symkey-cache
|
||||
|
||||
{% endif -%}
|
||||
|
||||
keyserver-options no-honor-keyserver-url no-auto-key-retrieve include-revoked
|
||||
|
||||
@@ -2,7 +2,7 @@ theme = "monokai"
|
||||
|
||||
[editor]
|
||||
idle-timeout = 0
|
||||
completion-trigger-len = 1
|
||||
completion-trigger-len = 2
|
||||
|
||||
[editor.statusline]
|
||||
left = [
|
||||
@@ -33,3 +33,12 @@ display-inlay-hints = true
|
||||
|
||||
[editor.cursor-shape]
|
||||
insert = "bar"
|
||||
|
||||
[editor.file-picker]
|
||||
hidden = false
|
||||
|
||||
[editor.indent-guides]
|
||||
render = true
|
||||
|
||||
[editor.soft-wrap]
|
||||
enable = true
|
||||
|
||||
@@ -6,6 +6,8 @@ icons = "awesome"
|
||||
[icons.overrides]
|
||||
microphone = ""
|
||||
volume = ""
|
||||
bat = "\uf240"
|
||||
music = "\uf1bc"
|
||||
|
||||
[theme]
|
||||
theme = "native"
|
||||
@@ -38,7 +40,7 @@ update = true
|
||||
block = "sound"
|
||||
driver = "pulseaudio"
|
||||
device_kind = "source"
|
||||
format = " $icon "
|
||||
format = " $icon "
|
||||
|
||||
[block.theme_overrides]
|
||||
warning_fg = { link = "idle_fg" }
|
||||
@@ -65,9 +67,8 @@ interval = 1
|
||||
[[block]]
|
||||
block = "battery"
|
||||
interval = 10
|
||||
format = " $percentage $time "
|
||||
format = " $icon $percentage $time "
|
||||
missing_format = ""
|
||||
if_command = "test -e /sys/class/power_supply/BAT0"
|
||||
|
||||
[[block]]
|
||||
block = "toggle"
|
||||
|
||||
13
install.sh
13
install.sh
@@ -50,13 +50,7 @@ sudowrap() {
|
||||
cache_updated=0
|
||||
_install() {
|
||||
_package="$1" ; shift
|
||||
if [[ $NAME == "Ubuntu" ]] ; then
|
||||
if ! (( cache_updated )) ; then
|
||||
sudowrap apt-get update
|
||||
cache_updated=1
|
||||
fi
|
||||
sudowrap apt-get install --assume-yes "${_package}"
|
||||
elif [[ $NAME == "Arch Linux" ]] ; then
|
||||
if [[ $NAME == "Arch Linux" ]] ; then
|
||||
sudowrap pacman -S --noconfirm "${_package}"
|
||||
else
|
||||
2>&1 printf "Unsupported distro $NAME, exiting"
|
||||
@@ -81,9 +75,4 @@ if [[ $NAME == "Arch Linux" ]] ; then
|
||||
_install "ansible"
|
||||
fi
|
||||
|
||||
if [[ $NAME == "Ubuntu" ]] ; then
|
||||
_install "ansible"
|
||||
_install "python3-jmespath"
|
||||
fi
|
||||
|
||||
cd "$DOTDIR" && make
|
||||
|
||||
253
packages.yml
253
packages.yml
@@ -1,10 +1,6 @@
|
||||
packages:
|
||||
list:
|
||||
build-essentials:
|
||||
ubuntu:
|
||||
- build-essential
|
||||
- exuberant-ctags
|
||||
- cmake
|
||||
archlinux:
|
||||
- gcc
|
||||
- ctags
|
||||
@@ -12,22 +8,16 @@ packages:
|
||||
- maven
|
||||
- base-devel
|
||||
make:
|
||||
ubuntu: ["make"]
|
||||
archlinux: ["make"]
|
||||
gdb:
|
||||
ubuntu: ["gdb"]
|
||||
archlinux: ["gdb"]
|
||||
strace:
|
||||
ubuntu: ["strace"]
|
||||
archlinux: ["strace"]
|
||||
sudo:
|
||||
ubuntu: ["sudo"]
|
||||
archlinux: ["sudo"]
|
||||
apt:
|
||||
ubuntu: ["apt-file"]
|
||||
archlinux: [""]
|
||||
xorg:
|
||||
ubuntu: []
|
||||
archlinux:
|
||||
- xorg-server
|
||||
- xorg-xrandr
|
||||
@@ -38,384 +28,335 @@ packages:
|
||||
- xorg-xset
|
||||
- xorg-xinit
|
||||
dmenu:
|
||||
ubuntu: ["dmenu"]
|
||||
archlinux: ["dmenu"]
|
||||
ansible:
|
||||
ubuntu: ["ansible"]
|
||||
archlinux: ["ansible"]
|
||||
archlinux:
|
||||
- ansible
|
||||
- ansible-language-server
|
||||
xdotool:
|
||||
ubuntu: ["xdotool"]
|
||||
archlinux: ["xdotool"]
|
||||
arandr:
|
||||
ubuntu: ["arandr"]
|
||||
archlinux: ["arandr"]
|
||||
borgbackup:
|
||||
ubuntu: ["borgbackup"]
|
||||
archlinux: ["borgbackup"]
|
||||
docker:
|
||||
ubuntu: ["docker.io", "containerd", "docker-compose"]
|
||||
archlinux: ["docker", "docker-compose"]
|
||||
font-awesome:
|
||||
ubuntu: ["fonts-font-awesome"]
|
||||
archlinux: ["ttf-font-awesome"]
|
||||
font-inconsolata:
|
||||
ubuntu: ["fonts-inconsolata"]
|
||||
archlinux: ["ttf-inconsolata"]
|
||||
font-dejavu:
|
||||
ubuntu: ["fonts-dejavu"]
|
||||
archlinux: ["ttf-dejavu"]
|
||||
font-libertine:
|
||||
ubuntu: ["fonts-linuxlibertine"]
|
||||
archlinux: ["ttf-linux-libertine"]
|
||||
font-emoji:
|
||||
ubuntu: []
|
||||
archlinux: ["noto-fonts-emoji"]
|
||||
git:
|
||||
ubuntu: ["git", "git-extras", "gitk", "git-email"]
|
||||
# tk required for gitk
|
||||
archlinux: ["git", "tk"]
|
||||
htop:
|
||||
ubuntu: ["htop"]
|
||||
archlinux: ["htop"]
|
||||
feh:
|
||||
ubuntu: ["feh"]
|
||||
archlinux: ["feh"]
|
||||
i3:
|
||||
ubuntu: ["i3"]
|
||||
archlinux: ["i3-wm"]
|
||||
archlinux:
|
||||
- i3-wm
|
||||
- i3status-rust
|
||||
i3lock:
|
||||
ubuntu: ["i3lock"]
|
||||
archlinux: ["i3lock"]
|
||||
pluma:
|
||||
ubuntu: ["pluma"]
|
||||
archlinux: ["pluma"]
|
||||
neovim:
|
||||
ubuntu: ["neovim"]
|
||||
archlinux: ["neovim", "python-pynvim"]
|
||||
network-manager-applet:
|
||||
ubuntu: []
|
||||
archlinux: ["network-manager-applet"]
|
||||
pasystray:
|
||||
ubuntu: ["pasystray"]
|
||||
archlinux: ["pasystray"]
|
||||
redshift:
|
||||
ubuntu: ["redshift-gtk"]
|
||||
archlinux: ["redshift"]
|
||||
pavucontrol:
|
||||
ubuntu: ["pavucontrol"]
|
||||
archlinux: ["pavucontrol-qt"]
|
||||
pinentry-qt:
|
||||
ubuntu: ["pinentry-curses", "pinentry-qt"]
|
||||
archlinux: ["pinentry"]
|
||||
pinta:
|
||||
ubuntu: ["pinta"]
|
||||
archlinux: ["pinta"]
|
||||
py3status:
|
||||
ubuntu: ["py3status", "python3-arrow", "python3-tzlocal", "python3-pydbus"]
|
||||
archlinux: ["py3status", "python-pytz", "python-tzlocal", "python-dbus", "python-pydbus"]
|
||||
pass:
|
||||
ubuntu: ["pass"]
|
||||
archlinux: ["pass", "passff-host"]
|
||||
keepassx:
|
||||
ubuntu: ["keepassx"]
|
||||
archlinux: []
|
||||
urxvt:
|
||||
ubuntu: ["rxvt-unicode-256color"]
|
||||
archlinux: ["rxvt-unicode"]
|
||||
alacritty:
|
||||
ubuntu: []
|
||||
archlinux: ["alacritty"]
|
||||
tmux:
|
||||
ubuntu: ["tmux"]
|
||||
archlinux: ["tmux"]
|
||||
screen:
|
||||
ubuntu: ["screen"]
|
||||
archlinux: ["screen"]
|
||||
zsh:
|
||||
ubuntu: ["zsh", "zsh-syntax-highlighting"]
|
||||
archlinux: ["zsh", "zsh-syntax-highlighting", "zsh-autosuggestions", "zsh-completions"]
|
||||
zathura:
|
||||
ubuntu: ["zathura", "zathura-pdf-poppler"]
|
||||
archlinux: ["zathura", "zathura-pdf-poppler"]
|
||||
pdf:
|
||||
ubuntu: ["ghostscript", "enscript"]
|
||||
archlinux: ["ghostscript", "enscript"]
|
||||
pandoc:
|
||||
ubuntu:
|
||||
- pandoc
|
||||
- texlive
|
||||
- python3-sphinxcontrib.svg2pdfconverter # for html to pdf conversions
|
||||
- texlive-latex-extra
|
||||
archlinux: ["pandoc", "texlive-core", "texlive-fontsextra", "texlive-latexextra"]
|
||||
libvirt:
|
||||
ubuntu: ["virt-manager", "libvirt-daemon"]
|
||||
archlinux: ["virt-manager", "libvirt", "dnsmasq", "ebtables", "dmidecode"]
|
||||
firefox:
|
||||
ubuntu: ["firefox"]
|
||||
archlinux: ["firefox"]
|
||||
ranger:
|
||||
ubuntu: ["ranger"]
|
||||
archlinux: ["ranger"]
|
||||
thunar:
|
||||
ubuntu: ["thunar"]
|
||||
archlinux: ["thunar"]
|
||||
unclutter:
|
||||
ubuntu: ["unclutter"]
|
||||
archlinux: ["unclutter"]
|
||||
libreoffice:
|
||||
ubuntu: ["libreoffice"]
|
||||
archlinux: ["libreoffice-fresh", "libreoffice-fresh-de"]
|
||||
qt-theming:
|
||||
ubuntu: ["breeze-cursor-theme", "breeze-icon-theme", "breeze", "qt5ct"]
|
||||
archlinux: ["breeze", "breeze-icons", "breeze-grub", "qt5ct"]
|
||||
gtk-theming:
|
||||
ubuntu: ["gtk3-engines-breeze", "lxappearance"]
|
||||
archlinux: ["breeze-gtk", "lxappearance"]
|
||||
xcompmgr:
|
||||
ubuntu: ["xcompmgr"]
|
||||
archlinux: ["xcompmgr"]
|
||||
python:
|
||||
ubuntu: ["python3", "python3-pip", "python3-venv", "virtualenv", "pylint3"]
|
||||
archlinux: ["python3"]
|
||||
archlinux:
|
||||
- python3
|
||||
- python-lsp-server
|
||||
python-modules:
|
||||
ubuntu: []
|
||||
archlinux:
|
||||
- python-ruamel-yaml
|
||||
- python-gitpython
|
||||
- python-semver
|
||||
black:
|
||||
ubuntu: ["black"]
|
||||
archlinux: ["python-black"]
|
||||
xbacklight:
|
||||
ubuntu: ["xbacklight"]
|
||||
archlinux: ["xorg-xbacklight"]
|
||||
wireshark:
|
||||
ubuntu: ["wireshark", "wireshark-qt"]
|
||||
archlinux: ["wireshark-cli", "wireshark-qt"]
|
||||
dia:
|
||||
ubuntu: ["dia"]
|
||||
archlinux: ["dia"]
|
||||
nmap:
|
||||
ubuntu: ["nmap"]
|
||||
archlinux: ["nmap"]
|
||||
openvpn:
|
||||
ubuntu: ["openvpn"]
|
||||
archlinux: ["openvpn"]
|
||||
curl:
|
||||
ubuntu: ["curl"]
|
||||
archlinux: ["curl"]
|
||||
wget:
|
||||
ubuntu: ["wget"]
|
||||
archlinux: ["wget"]
|
||||
tree:
|
||||
ubuntu: ["tree"]
|
||||
archlinux: ["tree"]
|
||||
which:
|
||||
ubuntu: []
|
||||
archlinux: ["which"]
|
||||
zip:
|
||||
ubuntu: ["zip", "unzip"]
|
||||
archlinux: ["zip", "unzip"]
|
||||
traceroute:
|
||||
ubuntu: ["traceroute"]
|
||||
archlinux: ["traceroute"]
|
||||
tcpdump:
|
||||
ubuntu: ["tcpdump"]
|
||||
archlinux: ["tcpdump"]
|
||||
tar:
|
||||
ubuntu: ["tar"]
|
||||
archlinux: ["tar"]
|
||||
rsync:
|
||||
ubuntu: ["rsync"]
|
||||
archlinux: ["rsync"]
|
||||
net-tools:
|
||||
ubuntu: ["net-tools"]
|
||||
archlinux: ["net-tools"]
|
||||
ntfs:
|
||||
ubuntu: ["ntfs-3g"]
|
||||
archlinux: ["ntfs-3g"]
|
||||
lsof:
|
||||
ubuntu: ["lsof"]
|
||||
archlinux: ["lsof"]
|
||||
iptables:
|
||||
ubuntu: ["iptables"]
|
||||
archlinux: ["iptables-nft"]
|
||||
pwgen:
|
||||
ubuntu: ["pwgen"]
|
||||
archlinux: ["pwgen"]
|
||||
gpg:
|
||||
ubuntu: ["gnupg2", "pcscd", "scdaemon"]
|
||||
archlinux: ["gnupg", "paperkey", "yubikey-manager", "yubikey-touch-detector"]
|
||||
networkmanager:
|
||||
ubuntu: ["network-manager", "network-manager-openvpn", "network-manager-openconnect", "network-manager-openconnect-gnome"]
|
||||
archlinux: ["networkmanager"]
|
||||
pulseaudio:
|
||||
ubuntu: ["pulseaudio", "pulseaudio-utils"]
|
||||
archlinux: ["pulseaudio", "pulseaudio-alsa", "lib32-libpulse"]
|
||||
archlinux:
|
||||
- pulseaudio
|
||||
- pulseaudio-alsa
|
||||
- lib32-libpulse
|
||||
- alsa-utils
|
||||
- alsa-firmware
|
||||
- sof-firmware
|
||||
- alsa-ucm-conf
|
||||
iw:
|
||||
ubuntu: ["iw"]
|
||||
archlinux: ["iw"]
|
||||
cowsay:
|
||||
ubuntu: ["cowsay"]
|
||||
archlinux: ["cowsay"]
|
||||
ruby:
|
||||
ubuntu: ["ruby", "ruby-dev", "ruby-bundler"]
|
||||
archlinux: ["ruby"]
|
||||
lxc:
|
||||
ubuntu: ["lxc"]
|
||||
archlinux: ["lxc"]
|
||||
acpi:
|
||||
ubuntu: ["acpid"]
|
||||
archlinux: ["acpi", "acpid"]
|
||||
nodejs:
|
||||
ubuntu: ["nodejs"]
|
||||
archlinux: ["nodejs", "npm"]
|
||||
xdg:
|
||||
ubuntu: ["xdg-utils"]
|
||||
archlinux: ["xdg-utils"]
|
||||
compton:
|
||||
ubuntu: ["compton"]
|
||||
archlinux: []
|
||||
dunst:
|
||||
ubuntu: ["dunst"]
|
||||
archlinux: ["dunst"]
|
||||
cloc:
|
||||
ubuntu: ["cloc"]
|
||||
archlinux: ["cloc"]
|
||||
bluetooth:
|
||||
ubuntu: ["blueman"]
|
||||
archlinux: ["bluez", "bluez-tools", "blueman"]
|
||||
autorandr:
|
||||
ubuntu: ["autorandr"]
|
||||
archlinux: ["autorandr"]
|
||||
bwm-ng:
|
||||
ubuntu: ["bwm-ng"]
|
||||
archlinux: ["bwm-ng"]
|
||||
virtualbox:
|
||||
ubuntu: ["virtualbox"]
|
||||
archlinux: ["virtualbox"]
|
||||
ssh:
|
||||
ubuntu: ["ssh"]
|
||||
archlinux: ["openssh"]
|
||||
sshfs:
|
||||
ubuntu: ["sshfs"]
|
||||
archlinux: ["sshfs"]
|
||||
expect:
|
||||
ubuntu: ["expect"]
|
||||
archlinux: ["expect"]
|
||||
inotify:
|
||||
ubuntu: ["inotify-tools"]
|
||||
archlinux: ["inotify-tools"]
|
||||
rclone:
|
||||
ubuntu: ["rclone"]
|
||||
archlinux: ["rclone"]
|
||||
dnf:
|
||||
ubuntu: []
|
||||
archlinux: []
|
||||
rustup:
|
||||
ubuntu: []
|
||||
archlinux: ["rustup"]
|
||||
musescore:
|
||||
ubuntu: ["musescore3"]
|
||||
archlinux: ["musescore"]
|
||||
sipcalc:
|
||||
ubuntu: ["sipcalc"]
|
||||
archlinux: ["sipcalc"]
|
||||
rofi:
|
||||
ubuntu: ["rofi"]
|
||||
archlinux: ["rofi"]
|
||||
imv:
|
||||
ubuntu: ["imv"]
|
||||
archlinux: ["imv"]
|
||||
pacman:
|
||||
ubuntu: []
|
||||
archlinux: ["pacman", "pacman-contrib"]
|
||||
steam:
|
||||
ubuntu: []
|
||||
archlinux: ["steam"]
|
||||
man:
|
||||
ubuntu: ["man-db", "manpages"]
|
||||
archlinux: ["man-db", "man-pages"]
|
||||
nextcloud:
|
||||
ubuntu: ["nextcloud-desktop"]
|
||||
archlinux: ["nextcloud-client"]
|
||||
kwallet:
|
||||
ubuntu: []
|
||||
archlinux: ["kwallet", "kwalletmanager"]
|
||||
pv:
|
||||
ubuntu: ["pv"]
|
||||
archlinux: ["pv"]
|
||||
stress:
|
||||
ubuntu: ["stress"]
|
||||
archlinux: ["stress"]
|
||||
mpris:
|
||||
ubuntu: ["playerctl"]
|
||||
archlinux: ["playerctl"]
|
||||
imagemagick:
|
||||
ubuntu: ["imagemagick"]
|
||||
archlinux: ["imagemagick"]
|
||||
mpv:
|
||||
ubuntu: ["mpv"]
|
||||
archlinux: ["mpv"]
|
||||
gnome-keyring:
|
||||
ubuntu: ["gnome-keyring"]
|
||||
archlinux: ["gnome-keyring"]
|
||||
element:
|
||||
ubuntu: []
|
||||
archlinux: ["element-desktop"]
|
||||
maim:
|
||||
ubuntu: ["maim"]
|
||||
archlinux: ["maim"]
|
||||
mkinitcpio:
|
||||
ubuntu: []
|
||||
archlinux: ["mkinitcpio"]
|
||||
terraform:
|
||||
ubuntu: []
|
||||
archlinux: ["terraform"]
|
||||
synclient:
|
||||
ubuntu: ["xserver-xorg-input-synaptics"]
|
||||
archlinux: ["xf86-input-synaptics"]
|
||||
ncdu:
|
||||
ubuntu: ["ncdu"]
|
||||
archlinux: ["ncdu"]
|
||||
font-utils:
|
||||
ubuntu: ["woff-tools", "woff2"]
|
||||
archlinux: ["woff2"]
|
||||
jq:
|
||||
ubuntu: ["jq"]
|
||||
archlinux: ["jq"]
|
||||
musl:
|
||||
ubuntu: ["musl", "musl-tools"]
|
||||
archlinux: ["musl"]
|
||||
kdeconnect:
|
||||
ubuntu: ["kdeconnect"]
|
||||
archlinux: ["kdeconnect"]
|
||||
restic:
|
||||
ubuntu: ["restic"]
|
||||
archlinux: ["restic"]
|
||||
discord:
|
||||
ubuntu: []
|
||||
archlinux: ["discord"]
|
||||
kubectl:
|
||||
archlinux: ["kubectl"]
|
||||
bind:
|
||||
archlinux: ["bind"]
|
||||
fzf:
|
||||
archlinux: ["fzf"]
|
||||
chromium:
|
||||
archlinux: ["chromium"]
|
||||
signal:
|
||||
archlinux: ["signal-desktop"]
|
||||
go:
|
||||
archlinux: ["go", "gopls"]
|
||||
helix:
|
||||
archlinux: ["helix"]
|
||||
keepassxc:
|
||||
archlinux: ["keepassxc"]
|
||||
awscli:
|
||||
archlinux: ["aws-cli"]
|
||||
mariadb-client:
|
||||
archlinux: ["mariadb-clients"]
|
||||
php:
|
||||
archlinux: ["php"]
|
||||
exa:
|
||||
archlinux: ["exa"]
|
||||
just:
|
||||
archlinux: ["just"]
|
||||
ripgrep:
|
||||
archlinux: ["ripgrep"]
|
||||
fd:
|
||||
archlinux: ["fd"]
|
||||
bat:
|
||||
archlinux: ["bat"]
|
||||
mdbook:
|
||||
archlinux: ["mdbook"]
|
||||
bash:
|
||||
archlinux:
|
||||
- bash
|
||||
- bash-language-server
|
||||
packer:
|
||||
archlinux: ["packer"]
|
||||
c:
|
||||
archlinux:
|
||||
- gcc
|
||||
- clang
|
||||
sed:
|
||||
archlinux:
|
||||
- sed
|
||||
findutils:
|
||||
archlinux:
|
||||
- findutils
|
||||
html:
|
||||
archlinux:
|
||||
- vscode-html-languageserver
|
||||
typescript:
|
||||
archlinux:
|
||||
- typescript
|
||||
- typescript-language-server
|
||||
json:
|
||||
archlinux:
|
||||
- vscode-json-languageserver
|
||||
markdown:
|
||||
archlinux:
|
||||
- marksman
|
||||
lldb:
|
||||
archlinux:
|
||||
- lldb
|
||||
yaml:
|
||||
archlinux:
|
||||
- yaml-language-server
|
||||
qemu:
|
||||
archlinux:
|
||||
- qemu-full
|
||||
- tigervnc
|
||||
cloud-init:
|
||||
archlinux:
|
||||
- cloud-init
|
||||
- cloud-utils
|
||||
netcat:
|
||||
archlinux:
|
||||
- openbsd-netcat
|
||||
|
||||
remove:
|
||||
mousepad:
|
||||
ubuntu: ["mousepad"]
|
||||
archlinux: ["mousepad"]
|
||||
chrome:
|
||||
ubuntu: ["google-chrome-stable"]
|
||||
archlinux: []
|
||||
snap:
|
||||
ubuntu: ["snapd"]
|
||||
archlinux: []
|
||||
golang:
|
||||
ubuntu: ["golang-go"]
|
||||
archlinux: ["go"]
|
||||
signal:
|
||||
ubuntu: []
|
||||
archlinux: ["signal-desktop"]
|
||||
vim:
|
||||
ubuntu: ["vim"]
|
||||
archlinux: ["gvim"]
|
||||
rust:
|
||||
ubuntu: ["rustc", "cargo"]
|
||||
archlinux: ["rust"]
|
||||
|
||||
615
playbook.yml
615
playbook.yml
@@ -23,64 +23,39 @@
|
||||
|
||||
- name: check for valid distro
|
||||
assert:
|
||||
that: distro in ('ubuntu', 'archlinux')
|
||||
that: distro in ('archlinux')
|
||||
|
||||
- block:
|
||||
- block:
|
||||
- name: update apt cache
|
||||
apt:
|
||||
update_cache: true
|
||||
become: true
|
||||
changed_when: false
|
||||
- name: install ansible requirements
|
||||
package:
|
||||
name: "{{ packages[distro] }}"
|
||||
state: present
|
||||
become: true
|
||||
vars:
|
||||
packages:
|
||||
archlinux:
|
||||
- python-jmespath
|
||||
|
||||
- name: upgrade system
|
||||
apt:
|
||||
upgrade: dist
|
||||
become: true
|
||||
- block:
|
||||
- name: enable multilib repository
|
||||
blockinfile:
|
||||
path: /etc/pacman.conf
|
||||
block: |
|
||||
[multilib]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
marker: "# {mark} ANSIBLE MANAGED multilib"
|
||||
become: true
|
||||
|
||||
- name: remove unused packages
|
||||
apt:
|
||||
autoremove: true
|
||||
become: true
|
||||
|
||||
- name: clean apt cache
|
||||
apt:
|
||||
autoclean: true
|
||||
become: true
|
||||
when: distro == 'ubuntu'
|
||||
- name: enable parallel download
|
||||
blockinfile:
|
||||
path: /etc/pacman.conf
|
||||
insertafter: '\[options\]'
|
||||
block: |
|
||||
ParallelDownloads = 5
|
||||
marker: "# {mark} ANSIBLE MANAGED parallel_download"
|
||||
become: true
|
||||
|
||||
- block:
|
||||
- name: install ansible requirements
|
||||
package:
|
||||
name: "{{ packages[distro] }}"
|
||||
state: present
|
||||
become: true
|
||||
vars:
|
||||
packages:
|
||||
archlinux:
|
||||
- python-jmespath
|
||||
ubuntu:
|
||||
- python3-jmespath
|
||||
|
||||
- block:
|
||||
- name: enable multilib repository
|
||||
blockinfile:
|
||||
path: /etc/pacman.conf
|
||||
block: |
|
||||
[multilib]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
marker: "# {mark} ANSIBLE MANAGED multilib"
|
||||
become: true
|
||||
|
||||
- name: enable parallel download
|
||||
blockinfile:
|
||||
path: /etc/pacman.conf
|
||||
insertafter: '\[options\]'
|
||||
block: |
|
||||
ParallelDownloads = 5
|
||||
marker: "# {mark} ANSIBLE MANAGED parallel_download"
|
||||
become: true
|
||||
|
||||
- name: upgrade system
|
||||
pacman:
|
||||
upgrade: true
|
||||
@@ -88,48 +63,49 @@
|
||||
become: true
|
||||
changed_when: false
|
||||
|
||||
- name: install pacman-contrib for paccache
|
||||
package:
|
||||
name: pacman-contrib
|
||||
state: present
|
||||
tags: [system-update]
|
||||
|
||||
- name: install pacman-contrib for paccache
|
||||
package:
|
||||
name: pacman-contrib
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- block:
|
||||
- name: install pacman cache clean service
|
||||
copy:
|
||||
dest: /etc/systemd/system/pacman-cache-cleanup.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
content: |
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c '/usr/bin/paccache -rk1 && /usr/bin/paccache -ruk0'
|
||||
RemainAfterExit=true
|
||||
become: true
|
||||
|
||||
- block:
|
||||
- name: install pacman cache clean service
|
||||
copy:
|
||||
dest: /etc/systemd/system/pacman-cache-cleanup.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
content: |
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c '/usr/bin/paccache -rk1 && /usr/bin/paccache -ruk0'
|
||||
RemainAfterExit=true
|
||||
become: true
|
||||
- name: install pacman cache clean timer
|
||||
copy:
|
||||
dest: /etc/systemd/system/pacman-cache-cleanup.timer
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
content: |
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
become: true
|
||||
|
||||
- name: install pacman cache clean timer
|
||||
copy:
|
||||
dest: /etc/systemd/system/pacman-cache-cleanup.timer
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
content: |
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
become: true
|
||||
- name: enable pacman cache clean timer
|
||||
systemd:
|
||||
name: pacman-cache-cleanup.timer
|
||||
enabled: true
|
||||
state: started
|
||||
daemon_reload: true
|
||||
become: true
|
||||
tags: [pacman_cache_cleanup]
|
||||
|
||||
- name: enable pacman cache clean timer
|
||||
systemd:
|
||||
name: pacman-cache-cleanup.timer
|
||||
enabled: true
|
||||
state: started
|
||||
daemon_reload: true
|
||||
become: true
|
||||
tags: [pacman_cache_cleanup]
|
||||
|
||||
when: distro == 'archlinux'
|
||||
tags: [system-update]
|
||||
when: distro == 'archlinux'
|
||||
|
||||
- block:
|
||||
- name: create dotfiles group
|
||||
@@ -310,7 +286,6 @@
|
||||
become: true
|
||||
vars:
|
||||
query: "{{ 'remove.*.%s[]'|format(distro) }}"
|
||||
when: distro != 'ubuntu'
|
||||
|
||||
- name: install packages
|
||||
package:
|
||||
@@ -320,16 +295,6 @@
|
||||
vars:
|
||||
query: "{{ 'list.*.%s[]'|format(distro) }}"
|
||||
|
||||
- name: remove packages
|
||||
apt:
|
||||
name: "{{ packages|json_query(query) }}"
|
||||
state: absent
|
||||
purge: true
|
||||
become: true
|
||||
vars:
|
||||
query: "{{ 'remove.*.%s[]'|format(distro) }}"
|
||||
when: distro == 'ubuntu'
|
||||
|
||||
- name: install machine-specific packages
|
||||
package:
|
||||
name: "{{ machine.packages }}"
|
||||
@@ -368,11 +333,6 @@
|
||||
- rebuild initrd
|
||||
when: distro == 'archlinux'
|
||||
|
||||
- set_fact:
|
||||
disable_services:
|
||||
- ssh
|
||||
when: distro == 'ubuntu'
|
||||
|
||||
- set_fact:
|
||||
disable_services:
|
||||
- sshd
|
||||
@@ -387,13 +347,6 @@
|
||||
become: true
|
||||
when: manage_services|default(true)|bool
|
||||
|
||||
- set_fact:
|
||||
enable_services:
|
||||
- NetworkManager
|
||||
- docker
|
||||
- libvirtd
|
||||
when: distro == 'ubuntu'
|
||||
|
||||
- set_fact:
|
||||
enable_services:
|
||||
- NetworkManager
|
||||
@@ -401,7 +354,6 @@
|
||||
- libvirtd
|
||||
- systemd-timesyncd
|
||||
- pcscd
|
||||
when: distro == 'archlinux'
|
||||
|
||||
- name: enable services
|
||||
service:
|
||||
@@ -440,23 +392,20 @@
|
||||
line: 'HandlePowerKey=suspend'
|
||||
become: true
|
||||
|
||||
- block:
|
||||
- name: create sudonopw group
|
||||
group:
|
||||
name: sudonopw
|
||||
system: true
|
||||
- name: create sudonopw group
|
||||
group:
|
||||
name: sudonopw
|
||||
system: true
|
||||
|
||||
- name: configure passwordless sudo
|
||||
copy:
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0600"
|
||||
dest: /etc/sudoers.d/sudonopw
|
||||
content: |
|
||||
%sudonopw ALL=(ALL) NOPASSWD: ALL
|
||||
become: true
|
||||
|
||||
when: distro == 'archlinux'
|
||||
- name: configure passwordless sudo
|
||||
copy:
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0600"
|
||||
dest: /etc/sudoers.d/sudonopw
|
||||
content: |
|
||||
%sudonopw ALL=(ALL) NOPASSWD: ALL
|
||||
become: true
|
||||
|
||||
- block:
|
||||
- name: install AMDGPU packages
|
||||
@@ -494,411 +443,6 @@
|
||||
- machine.gpu is defined and machine.gpu == 'amd'
|
||||
|
||||
- block:
|
||||
- name: create rust build user
|
||||
user:
|
||||
name: rust_build
|
||||
home: /var/lib/rust_build
|
||||
create_home: true
|
||||
shell: /bin/bash
|
||||
system: true
|
||||
become: true
|
||||
|
||||
- set_fact:
|
||||
cargo_env: . ~/.cargo/env
|
||||
when: distro == 'ubuntu'
|
||||
|
||||
- set_fact:
|
||||
# Do NOT just use `"true"`. Due to some YAML fuckery, it will be
|
||||
# capitalized and the commands will fail.
|
||||
cargo_env: "/bin/true"
|
||||
when: distro == 'archlinux'
|
||||
|
||||
- name: install rustup on ubuntu
|
||||
shell: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
|
||||
args:
|
||||
creates: /var/lib/rust_build/.cargo/bin/rustup
|
||||
become: true
|
||||
become_user: rust_build
|
||||
when: distro == 'ubuntu'
|
||||
|
||||
- name: add rustup stable toolchain
|
||||
shell: "{{ cargo_env }} && rustup toolchain install stable && rustup default stable"
|
||||
become: true
|
||||
become_user: rust_build
|
||||
changed_when: false
|
||||
|
||||
- name: add rustup nightly toolchain
|
||||
shell: "{{ cargo_env }} && rustup toolchain install nightly"
|
||||
become: true
|
||||
become_user: rust_build
|
||||
changed_when: false
|
||||
|
||||
- name: add rustup additional toolchains
|
||||
shell: "{{ cargo_env }} && rustup toolchain install {{ item }}"
|
||||
become: true
|
||||
become_user: rust_build
|
||||
changed_when: false
|
||||
loop: "{{ cargo_crate_list|selectattr('toolchain', 'defined')|map(attribute='toolchain')|reject('in', ['none', 'stable', 'nightly'])|list }}"
|
||||
|
||||
- name: add additional targets
|
||||
shell: "{{ cargo_env }} && rustup +{{ item.toolchain|default('stable') }} target add {{ item.target }}"
|
||||
become: true
|
||||
become_user: rust_build
|
||||
changed_when: false
|
||||
when:
|
||||
- '"target" in item'
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
|
||||
- name: assert that nofeatures is not actually a flag
|
||||
assert:
|
||||
that: '"nofeatures" not in item.features|default([])'
|
||||
msg: Wow, "nofeatures" is actually a feature. Update the playbook!
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
|
||||
- name: assert that only proper sources are defined
|
||||
assert:
|
||||
that: item.source|default("crates.io") in ("crates.io", "git")
|
||||
msg: "Invalid source: {{ item.source|default('x') }}"
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
|
||||
- name: install required packages
|
||||
package:
|
||||
state: present
|
||||
name: "{{ item.required_packages|map(attribute=distro)|list }}"
|
||||
when: item.required_packages is defined
|
||||
become: true
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
|
||||
- name: check if binary already exists for crates.io
|
||||
stat:
|
||||
path: /usr/local/lib/binaries/{{ binary_id_cratesio }}
|
||||
register: rust_binary_cratesio
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
loop_control:
|
||||
label: "{{ item.binary }}"
|
||||
when: item.source|default('crates.io') == 'crates.io'
|
||||
check_mode: false
|
||||
|
||||
- name: check if binary already exists for git
|
||||
stat:
|
||||
path: /usr/local/lib/binaries/{{ binary_id_git }}
|
||||
register: rust_binary_git
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
loop_control:
|
||||
label: "{{ item.binary }}"
|
||||
when: item.source|default('crates.io') == 'git'
|
||||
check_mode: false
|
||||
|
||||
- name: build rust crates from crates.io
|
||||
shell: |
|
||||
set -o errexit
|
||||
{{ cargo_env }}
|
||||
|
||||
rustup run {{ item.toolchain|default('stable') }} cargo install --features "{{ item.features|default([])|join(' ') }}" {{ "--target " ~ item.target if item.target is defined else '' }} --version {{ item.version }} {{ item.crate }}
|
||||
mv /var/lib/rust_build/.cargo/bin/{{ item.binary }} /var/lib/rust_build/.cargo/bin/{{ binary_id_cratesio }}
|
||||
args:
|
||||
creates: /var/lib/rust_build/.cargo/bin/{{ binary_id_cratesio }}
|
||||
become: true # do not build as root!
|
||||
become_user: rust_build
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
when:
|
||||
- item.source|default('crates.io') == 'crates.io'
|
||||
- not ((rust_binary_cratesio.results | selectattr("item.binary", "match", item.binary)) | list) [0].stat.exists
|
||||
|
||||
- name: build rust crates from git
|
||||
shell: |
|
||||
set -o errexit
|
||||
{{ cargo_env }}
|
||||
rustup run {{ item.toolchain|default('stable') }} cargo install --features "{{ item.features|default([])|join(' ') }}" {{ "--target " ~ item.target if item.target is defined else '' }} --git {{ item.url }} --branch {{ item.branch }} {{ item.package|default("") }}
|
||||
mv /var/lib/rust_build/.cargo/bin/{{ item.binary }} /var/lib/rust_build/.cargo/bin/{{ binary_id_git }}
|
||||
args:
|
||||
creates: /var/lib/rust_build/.cargo/bin/{{ binary_id_git }}
|
||||
become: true # do not build as root!
|
||||
become_user: rust_build
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
when:
|
||||
- item.source|default('crates.io') == 'git'
|
||||
- not ((rust_binary_git.results | selectattr("item.binary", "match", item.binary)) | list)[0].stat.exists
|
||||
|
||||
- name: create target directory
|
||||
file:
|
||||
state: directory
|
||||
path: /usr/local/lib/binaries/
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0775'
|
||||
become: true
|
||||
|
||||
- name: move binaries for crates.io
|
||||
shell: |
|
||||
mv /var/lib/rust_build/.cargo/bin/{{ binary_id_cratesio }} /usr/local/lib/binaries/{{ binary_id_cratesio }}
|
||||
args:
|
||||
creates: /usr/local/lib/binaries/{{ binary_id_cratesio }}
|
||||
become: true
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
when:
|
||||
- item.source|default('crates.io') == 'crates.io'
|
||||
- not ((rust_binary_cratesio.results | selectattr("item.binary", "match", item.binary)) | list)[0].stat.exists
|
||||
|
||||
- name: move binaries for git
|
||||
shell: |
|
||||
mv /var/lib/rust_build/.cargo/bin/{{ binary_id_git }} /usr/local/lib/binaries/{{ binary_id_git }}
|
||||
args:
|
||||
creates: /usr/local/lib/binaries/{{ binary_id_git }}
|
||||
become: true
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
when:
|
||||
- item.source|default('crates.io') == 'git'
|
||||
- not ((rust_binary_git.results | selectattr("item.binary", "match", item.binary)) | list)[0].stat.exists
|
||||
|
||||
- name: link binaries for crates.io
|
||||
file:
|
||||
src: /usr/local/lib/binaries/{{ binary_id_cratesio }}
|
||||
dest: /usr/local/bin/{{ item.binary }}
|
||||
owner: root
|
||||
group: root
|
||||
state: link
|
||||
force: true
|
||||
become: true
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
when: item.source|default('crates.io') == 'crates.io'
|
||||
|
||||
- name: link binaries for git
|
||||
file:
|
||||
src: /usr/local/lib/binaries/{{ binary_id_git }}
|
||||
dest: /usr/local/bin/{{ item.binary }}
|
||||
owner: root
|
||||
group: root
|
||||
state: link
|
||||
force: true
|
||||
become: true
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
when: item.source|default('crates.io') == 'git'
|
||||
|
||||
# Important: clean up the symlinks BEFORE the binaries they point to.
|
||||
# Otherwise, ansible will skip them because `ansible.builtin.fileglob`
|
||||
# does not match broken symlinks for some reason.
|
||||
- name: clean up old binaries for creates.io in /var/lib/rust_build
|
||||
command: rm -- {{ binaries | join (" ") }}
|
||||
vars:
|
||||
binaries: "{{ lookup('ansible.builtin.fileglob', '/var/lib/rust_build/.cargo/bin/' ~ item.binary ~ '.*', wantlist=True) | reject('eq', '/var/lib/rust_build/.cargo/bin/' ~ binary_id_cratesio) | list }}"
|
||||
changed_when: binaries | length > 0
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
become: true
|
||||
when:
|
||||
- item.source|default('crates.io') == 'crates.io'
|
||||
- binaries | length > 0
|
||||
|
||||
- name: clean up old binaries for creates.io in /usr/local/lib
|
||||
command: rm -- {{ binaries | join (" ") }}
|
||||
vars:
|
||||
binaries: "{{ lookup('ansible.builtin.fileglob', '/usr/local/lib/binaries/' ~ item.binary ~ '.*', wantlist=True) | reject('eq', '/usr/local/lib/binaries/' ~ binary_id_cratesio) | list }}"
|
||||
changed_when: binaries | length > 0
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
become: true
|
||||
when:
|
||||
- item.source|default('crates.io') == 'crates.io'
|
||||
- binaries | length > 0
|
||||
|
||||
- name: clean up old binaries for git in /var/lib/rust_build
|
||||
command: rm -- {{ binaries | join (" ") }}
|
||||
vars:
|
||||
binaries: "{{ lookup('ansible.builtin.fileglob', '/var/lib/rust_build/.cargo/bin/' ~ item.binary ~ '.*', wantlist=True) | reject('eq', '/var/lib/rust_build/.cargo/bin/' ~ binary_id_git) | list }}"
|
||||
changed_when: binaries | length > 0
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
become: true
|
||||
when:
|
||||
- item.source|default('crates.io') == 'git'
|
||||
- binaries | length > 0
|
||||
|
||||
- name: clean up old binaries for git in /usr/local/lib
|
||||
command: rm -- {{ binaries | join (" ") }}
|
||||
vars:
|
||||
binaries: "{{ lookup('ansible.builtin.fileglob', '/usr/local/lib/binaries/' ~ item.binary ~ '.*', wantlist=True) | reject('eq', '/usr/local/lib/binaries/' ~ binary_id_git) | list }}"
|
||||
changed_when: binaries | length > 0
|
||||
loop: "{{ cargo_crate_list }}"
|
||||
become: true
|
||||
when:
|
||||
- item.source|default('crates.io') == 'git'
|
||||
- binaries | length > 0
|
||||
|
||||
vars:
|
||||
binary_id_cratesio: "{{ item.binary }}.{{ item.toolchain|default('stable') }}.{{ item.features|default(['nofeatures'])|join('_') }}.{{ item.version }}"
|
||||
binary_id_git: "{{ item.binary }}.{{ item.toolchain|default('stable') }}.{{ item.features|default(['nofeatures'])|join('_') }}.{{ item.branch }}"
|
||||
tags:
|
||||
- rust_binaries
|
||||
|
||||
- block:
|
||||
- name: stat go target directory
|
||||
stat:
|
||||
path: /usr/local/go-v{{ go_version }}
|
||||
register: go_target_stat
|
||||
|
||||
- block:
|
||||
- name: create temporary directory for go download
|
||||
tempfile:
|
||||
state: directory
|
||||
register: go_download
|
||||
|
||||
- name: download go
|
||||
get_url:
|
||||
url: https://golang.org/dl/go{{ go_version }}.linux-amd64.tar.gz
|
||||
dest: "{{ go_download.path }}/go{{ go_version }}.linux-amd64.tar.gz"
|
||||
force: false
|
||||
|
||||
- name: unpack go
|
||||
unarchive:
|
||||
src: "{{ go_download.path }}/go{{ go_version }}.linux-amd64.tar.gz"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
dest: "{{ go_download.path }}"
|
||||
remote_src: true
|
||||
become: true
|
||||
|
||||
- name: install new go version
|
||||
command: mv "{{ go_download.path }}/go/" /usr/local/go-v{{ go_version }}
|
||||
become: true
|
||||
|
||||
- name: clean up go download directory
|
||||
file:
|
||||
path: "{{ go_download.path }}"
|
||||
state: absent
|
||||
|
||||
when: not go_target_stat.stat.exists and not ansible_check_mode
|
||||
|
||||
- name: link to the current go version
|
||||
file:
|
||||
src: /usr/local/go-v{{ go_version }}
|
||||
dest: /usr/local/go
|
||||
owner: root
|
||||
group: root
|
||||
state: link
|
||||
force: true
|
||||
become: true
|
||||
|
||||
- name: add go directory to PATH and set GOROOT
|
||||
copy:
|
||||
dest: /etc/profile.d/go.sh
|
||||
content: |
|
||||
export PATH=/usr/local/go/bin:$PATH
|
||||
export GOROOT=/usr/local/go
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
become: true
|
||||
|
||||
tags: [go]
|
||||
|
||||
- block:
|
||||
- name: install alacritty build dependencies
|
||||
package:
|
||||
state: present
|
||||
# https://github.com/alacritty/alacritty/blob/master/INSTALL.md#debianubuntu
|
||||
name:
|
||||
- cmake
|
||||
- pkg-config
|
||||
- libfreetype6-dev
|
||||
- libfontconfig1-dev
|
||||
- libxcb-xfixes0-dev
|
||||
- libxkbcommon-dev
|
||||
- python3
|
||||
become: true
|
||||
|
||||
- name: stat alacritty binary
|
||||
stat:
|
||||
path: /usr/local/bin/alacritty
|
||||
register: alacritty_binary
|
||||
|
||||
- name: create temporary directory for alacritty build
|
||||
tempfile:
|
||||
state: directory
|
||||
register: alacritty_build_tempdir
|
||||
become: true
|
||||
become_user: rust_build
|
||||
when: not alacritty_binary.stat.exists
|
||||
|
||||
- name: build alacritty
|
||||
shell: . ~/.cargo/env && rustup run stable cargo install alacritty --root ./out
|
||||
args:
|
||||
chdir: "{{ alacritty_build_tempdir.path }}"
|
||||
become: true
|
||||
become_user: rust_build
|
||||
when: not alacritty_binary.stat.exists
|
||||
|
||||
- name: install alacritty
|
||||
command: mv "{{ alacritty_build_tempdir.path }}/out/bin/alacritty" /usr/local/bin/alacritty
|
||||
become: true
|
||||
when: not alacritty_binary.stat.exists
|
||||
|
||||
- name: clean up build directory
|
||||
file:
|
||||
path: "{{ alacritty_build_tempdir.path }}"
|
||||
state: absent
|
||||
become: true
|
||||
become_user: rust_build
|
||||
when: not alacritty_binary.stat.exists
|
||||
|
||||
when: distro == 'ubuntu'
|
||||
tags: [alacritty]
|
||||
|
||||
- block:
|
||||
- name: stat yubikey-touch-detector binary
|
||||
stat:
|
||||
path: /usr/local/bin/yubikey-touch-detector
|
||||
register: yubikey_touch_detector_binary
|
||||
|
||||
- name: create temporary directory for yubikey-touch-detector build
|
||||
tempfile:
|
||||
state: directory
|
||||
register: yubikey_touch_detector_build_tempdir
|
||||
when: not yubikey_touch_detector_binary.stat.exists
|
||||
|
||||
- name: build yubikey-touch-detector
|
||||
shell: sh -c 'PATH=/usr/local/go/bin:$PATH env GOROOT=/usr/local/go GOPATH=$(pwd) go install github.com/maximbaz/yubikey-touch-detector@main'
|
||||
args:
|
||||
chdir: "{{ yubikey_touch_detector_build_tempdir.path }}"
|
||||
when: not yubikey_touch_detector_binary.stat.exists
|
||||
|
||||
- name: install yubikey-touch-detector
|
||||
command: >
|
||||
mv
|
||||
"{{ yubikey_touch_detector_build_tempdir.path }}/bin/yubikey-touch-detector"
|
||||
/usr/local/bin/yubikey-touch-detector
|
||||
become: true
|
||||
when: not yubikey_touch_detector_binary.stat.exists
|
||||
|
||||
- name: clean up build directory
|
||||
file:
|
||||
path: "{{ yubikey_touch_detector_build_tempdir.path }}"
|
||||
state: absent
|
||||
become: true
|
||||
when: not yubikey_touch_detector_binary.stat.exists
|
||||
|
||||
when: distro == 'ubuntu'
|
||||
tags: [yubikey-touch-detector]
|
||||
|
||||
- block:
|
||||
- block:
|
||||
- name: add spotify apt key
|
||||
apt_key:
|
||||
url: "https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg"
|
||||
id: "5E3C45D7B312C643"
|
||||
become: true
|
||||
|
||||
- name: add spotify repository
|
||||
apt_repository:
|
||||
repo: "deb http://repository.spotify.com stable non-free"
|
||||
filename: spotify
|
||||
become: true
|
||||
|
||||
- name: install spotify
|
||||
apt:
|
||||
name: spotify-client
|
||||
update_cache: true
|
||||
become: true
|
||||
when: distro == 'ubuntu'
|
||||
|
||||
- block:
|
||||
- name: install spotify from AUR via paru
|
||||
shell: |
|
||||
@@ -908,7 +452,6 @@
|
||||
become_user: paru
|
||||
args:
|
||||
creates: /usr/bin/spotify
|
||||
when: distro == 'archlinux'
|
||||
|
||||
tags: [spotify]
|
||||
|
||||
|
||||
@@ -51,25 +51,29 @@ test_ares() {
|
||||
}
|
||||
|
||||
test_neptune() {
|
||||
docker pull docker.io/library/ubuntu:20.04
|
||||
docker run -ti --rm -v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro --hostname neptune docker.io/library/ubuntu:20.04 sh -c '
|
||||
set -o errexit
|
||||
docker run \
|
||||
-ti \
|
||||
--rm \
|
||||
-v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro \
|
||||
--mount type=tmpfs,destination=/var/cache/pacman/pkg/ \
|
||||
"${dockeropts[@]}" \
|
||||
--hostname neptune \
|
||||
docker.io/library/archlinux:base \
|
||||
sh -c '
|
||||
set -o errexit
|
||||
|
||||
cd $(mktemp -d)
|
||||
tar xf /tmp/dotfiles.tar.gz -C .
|
||||
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
|
||||
'
|
||||
}
|
||||
# Uncomment CacheDir and append the host pacman cache as cachedir
|
||||
# At worst, the cache directory will be ignored if it does not exist
|
||||
# Pacman will always prefer the first cache directory, so newly downloaded
|
||||
# packages will stay in the container
|
||||
sed -i '"'"'s/^#\?\(CacheDir.*\)/CacheDir = \/var\/cache\/pacman\/pkg_host\/\n\1/'"'"' /etc/pacman.conf
|
||||
|
||||
test_mars() {
|
||||
docker pull docker.io/library/ubuntu:20.04
|
||||
docker run -ti --rm -v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro --hostname mars docker.io/library/ubuntu:20.04 sh -c '
|
||||
set -o errexit
|
||||
|
||||
cd $(mktemp -d)
|
||||
tar xf /tmp/dotfiles.tar.gz -C .
|
||||
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
|
||||
'
|
||||
mkdir -p /var/cache/pacman/pkg_host/
|
||||
pacman -Syu --noconfirm linux
|
||||
cd $(mktemp -d)
|
||||
tar xf /tmp/dotfiles.tar.gz -C .
|
||||
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
|
||||
'
|
||||
}
|
||||
|
||||
case "${1:-all}" in
|
||||
@@ -79,12 +83,8 @@ case "${1:-all}" in
|
||||
neptune)
|
||||
test_neptune
|
||||
;;
|
||||
mars)
|
||||
test_mars
|
||||
;;
|
||||
all)
|
||||
test_ares
|
||||
test_neptune
|
||||
test_mars
|
||||
;;
|
||||
esac
|
||||
|
||||
152
user.yml
152
user.yml
@@ -13,18 +13,6 @@
|
||||
become: true
|
||||
become_user: root
|
||||
|
||||
- set_fact:
|
||||
user_groups:
|
||||
- adm
|
||||
- cdrom
|
||||
- sudo
|
||||
- dip
|
||||
- plugdev
|
||||
- docker
|
||||
- libvirt
|
||||
when: distro == 'ubuntu'
|
||||
tags: [always]
|
||||
|
||||
- set_fact:
|
||||
user_groups:
|
||||
- libvirt
|
||||
@@ -35,7 +23,6 @@
|
||||
- sudonopw
|
||||
- games
|
||||
- kvm
|
||||
when: distro == 'archlinux'
|
||||
tags: [always]
|
||||
|
||||
- set_fact:
|
||||
@@ -203,7 +190,7 @@
|
||||
|
||||
- name: deploy dotfiles templates
|
||||
template:
|
||||
src: /home/{{ user.name }}/.dotfiles/{{ item.from }}.j2
|
||||
src: /var/lib/dotfiles/{{ item.from }}.j2
|
||||
dest: "/home/{{ user.name }}/{{ item.to }}"
|
||||
owner: "{{ user.name }}"
|
||||
group: "{{ user_group_name }}"
|
||||
@@ -323,14 +310,6 @@
|
||||
tags: [user-update]
|
||||
tags: [vim-plugins]
|
||||
|
||||
- block:
|
||||
- name: install rustup on ubuntu
|
||||
shell: curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path
|
||||
args:
|
||||
creates: ~/.cargo/bin/rustup
|
||||
when: distro == 'ubuntu'
|
||||
tags: [rust]
|
||||
|
||||
- block:
|
||||
- name: create firefox directories
|
||||
firefox_profile:
|
||||
@@ -523,135 +502,9 @@
|
||||
group: "{{ user_group_name }}"
|
||||
state: link
|
||||
force: true
|
||||
|
||||
tags:
|
||||
- portfolio-performance
|
||||
|
||||
- block:
|
||||
- name: get current stable version
|
||||
uri:
|
||||
url: https://storage.googleapis.com/kubernetes-release/release/stable.txt
|
||||
return_content: true
|
||||
register: kubectl_stable_version_api
|
||||
check_mode: false
|
||||
|
||||
- set_fact:
|
||||
kubectl_stable_version: "{{ kubectl_stable_version_api.content|trim }}"
|
||||
|
||||
- set_fact:
|
||||
kubectl_outdated: "{{ kubectl_version != kubectl_stable_version }}"
|
||||
|
||||
- name: warn if not on stable version
|
||||
fail:
|
||||
msg: "installing kubectl {{ kubectl_version }}, stable version would be {{ kubectl_stable_version }}"
|
||||
when: kubectl_outdated is sameas true
|
||||
ignore_errors: True
|
||||
|
||||
- name: get kubectl
|
||||
get_url:
|
||||
url: https://storage.googleapis.com/kubernetes-release/release/{{ kubectl_version }}/bin/linux/amd64/kubectl
|
||||
dest: /home/{{ user.name }}/.opt/kubectl-{{ kubectl_version }}
|
||||
owner: "{{ user.name }}"
|
||||
group: "{{ user_group_name }}"
|
||||
mode: '0755'
|
||||
force: false
|
||||
|
||||
- name: make kubectl executable
|
||||
file:
|
||||
path: /home/{{ user.name }}/.opt/kubectl-{{ kubectl_version }}
|
||||
mode: '0755'
|
||||
when: not ansible_check_mode
|
||||
|
||||
- name: link kubectl
|
||||
file:
|
||||
src: /home/{{ user.name }}/.opt/kubectl-{{ kubectl_version }}
|
||||
dest: /home/{{ user.name }}/.optbin/kubectl
|
||||
state: link
|
||||
when: not ansible_check_mode
|
||||
|
||||
tags:
|
||||
- kubectl
|
||||
|
||||
- block:
|
||||
- set_fact:
|
||||
tf_version: "{{ user.overrides.terraform_version|default(terraform_version) }}"
|
||||
tf_check_updates: "{{ user.overrides.terraform_check_updates|default(terraform_check_updates)|default(true) }}"
|
||||
|
||||
- name: stat current terraform binary
|
||||
stat:
|
||||
path: "/home/{{ user.name }}/.opt/terraform-v{{ tf_version }}"
|
||||
register: terraform_binary
|
||||
check_mode: false
|
||||
|
||||
- name: create temporary download directory for terraform
|
||||
tempfile:
|
||||
state: directory
|
||||
register: terraform_download_dir
|
||||
when:
|
||||
- not ansible_check_mode
|
||||
- not terraform_binary.stat.exists
|
||||
|
||||
- name: get terraform
|
||||
get_url:
|
||||
url: "https://releases.hashicorp.com/terraform/{{ tf_version }}/terraform_{{ tf_version }}_linux_amd64.zip"
|
||||
dest: "{{ terraform_download_dir.path }}/terraform.zip"
|
||||
force: false
|
||||
when:
|
||||
- not ansible_check_mode
|
||||
- not terraform_binary.stat.exists
|
||||
|
||||
- name: unpack terraform zip
|
||||
unarchive:
|
||||
src: "{{ terraform_download_dir.path }}/terraform.zip"
|
||||
dest: "{{ terraform_download_dir.path }}/"
|
||||
remote_src: true
|
||||
when:
|
||||
- not ansible_check_mode
|
||||
- not terraform_binary.stat.exists
|
||||
|
||||
- name: install terraform
|
||||
command: mv "{{ terraform_download_dir.path }}/terraform" /home/{{ user.name }}/.opt/terraform-v{{ tf_version }}
|
||||
when:
|
||||
- not ansible_check_mode
|
||||
- not terraform_binary.stat.exists
|
||||
|
||||
- name: clean up download directory
|
||||
file:
|
||||
path: "{{ terraform_download_dir.path }}"
|
||||
state: absent
|
||||
when:
|
||||
- not ansible_check_mode
|
||||
- not terraform_binary.stat.exists
|
||||
|
||||
- name: link terraform
|
||||
file:
|
||||
src: /home/{{ user.name }}/.opt/terraform-v{{ tf_version }}
|
||||
dest: /home/{{ user.name }}/.optbin/terraform
|
||||
state: link
|
||||
when: not ansible_check_mode
|
||||
|
||||
- block:
|
||||
- name: get terraform version info
|
||||
command: /home/{{ user.name }}/.optbin/terraform version -json
|
||||
register: terraform_version_output
|
||||
check_mode: false
|
||||
changed_when: false
|
||||
|
||||
- name: parse terraform version output
|
||||
set_fact:
|
||||
terraform_outdated: "{{ (terraform_version_output.stdout | from_json()).terraform_outdated }}"
|
||||
changed_when: false
|
||||
|
||||
- name: warn if terraform is outdated
|
||||
fail:
|
||||
msg: "current terraform v{{ tf_version }} is out of date"
|
||||
when: terraform_outdated is sameas true
|
||||
ignore_errors: True
|
||||
when: tf_check_updates
|
||||
|
||||
tags:
|
||||
- terraform
|
||||
|
||||
- name: handle autostart units
|
||||
block:
|
||||
- name: create systemd user directory
|
||||
@@ -725,6 +578,9 @@
|
||||
content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
|
||||
if [[ ! -e ~/.password-store ]] ; then
|
||||
printf '%s\n' 'This is the first time running pass, initializting repository ...'
|
||||
|
||||
|
||||
@@ -1,41 +1 @@
|
||||
terraform_version: 1.3.6
|
||||
kubectl_version: v1.26.0
|
||||
go_version: "1.19.4"
|
||||
portfolio_performace_version: "0.57.2"
|
||||
cargo_crate_list:
|
||||
- crate: just
|
||||
binary: just
|
||||
version: 1.9.0
|
||||
- crate: ripgrep
|
||||
binary: rg
|
||||
version: 13.0.0
|
||||
features:
|
||||
- pcre2
|
||||
required_packages:
|
||||
- ubuntu: libpcre2-dev
|
||||
archlinux: pcre2
|
||||
- crate: fd-find
|
||||
binary: fd
|
||||
version: 8.6.0
|
||||
- crate: bat
|
||||
binary: bat
|
||||
version: 0.22.1
|
||||
- crate: exa
|
||||
binary: exa
|
||||
version: 0.10.1
|
||||
- crate: mdbook
|
||||
binary: mdbook
|
||||
version: 0.4.24
|
||||
- url: https://github.com/hakoerber/git-repo-manager
|
||||
binary: grm
|
||||
branch: develop
|
||||
source: git
|
||||
toolchain: nightly
|
||||
features:
|
||||
- static-build
|
||||
target: x86_64-unknown-linux-musl
|
||||
- url: https://github.com/greshake/i3status-rust
|
||||
binary: i3status-rs
|
||||
branch: master
|
||||
source: git
|
||||
package: i3status-rs
|
||||
|
||||
@@ -11,8 +11,8 @@ for part in ${_path[@]} ; do
|
||||
done
|
||||
export PATH
|
||||
|
||||
export EDITOR="hx"
|
||||
export VISUAL="hx"
|
||||
export EDITOR="helix"
|
||||
export VISUAL="helix"
|
||||
export BROWSER="firefox"
|
||||
|
||||
export PAGER="less"
|
||||
@@ -55,7 +55,6 @@ mkdir -p "${FEATURE_DIR}"
|
||||
[[ $MACHINE_HAS_KEEPASSX == "true" ]] && touch "${FEATURE_DIR}"/keepassx
|
||||
[[ $MACHINE_HAS_STEAM == "true" ]] && touch "${FEATURE_DIR}"/steam
|
||||
[[ $MACHINE_HAS_RESTIC_BACKUP == "true" ]] && touch "${FEATURE_DIR}"/restic_backup
|
||||
[[ $MACHINE_HAS_ELEMENT == "true" ]] && touch "${FEATURE_DIR}"/element
|
||||
|
||||
[[ $MACHINE_TYPE == "laptop" ]] && touch "${FEATURE_DIR}"/machine_is_laptop
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
|
||||
alias rg='rg --hidden --glob "!.git/**"'
|
||||
|
||||
alias rm='rm -v'
|
||||
alias cp='cp -vi'
|
||||
alias mv='mv -vi'
|
||||
|
||||
@@ -24,3 +24,6 @@ bindkey "\e[H" beginning-of-line
|
||||
bindkey "\e[F" end-of-line
|
||||
# completion in the middle of a line
|
||||
bindkey '^i' expand-or-complete-prefix
|
||||
|
||||
export FZF_DEFAULT_OPTS='--height 50% --border'
|
||||
eval "$(fzf --zsh)"
|
||||
|
||||
@@ -27,7 +27,3 @@ if [[ ! "$SSH_AUTH_SOCK" ]]; then
|
||||
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
|
||||
fi
|
||||
{% endif %}
|
||||
|
||||
{% if distro == 'ubuntu' %}
|
||||
alias imv=imv-x11
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user