diff --git a/config/automatrop/roles/software/handlers/main.yml b/config/automatrop/roles/software/handlers/main.yml index 77440be..66f7ee5 100644 --- a/config/automatrop/roles/software/handlers/main.yml +++ b/config/automatrop/roles/software/handlers/main.yml @@ -13,4 +13,5 @@ use: makepkg state: latest listen: "software changed" + when: root_access when: arch_based diff --git a/config/automatrop/roles/software/tasks/main.yml b/config/automatrop/roles/software/tasks/main.yml index aee4dfc..b07648d 100644 --- a/config/automatrop/roles/software/tasks/main.yml +++ b/config/automatrop/roles/software/tasks/main.yml @@ -9,13 +9,6 @@ ubuntu: "{{ ansible_distribution == 'Ubuntu' }}" tags: softwarelist -# TODO Is this used? -- name: Set secondary variables - set_fact: - pacman: "{{ arch_based }}" - apt: "{{ termux or debian }}" - sudo: "{{ not termux }}" - # TODO Install python if not done # Or maybe not, it requires a lot of automation for something that can be done # very quickly manually and is usually uneccessary @@ -80,18 +73,19 @@ name: - fakeroot - base-devel - when: arch_based - become: "{{ sudo }}" + become: yes + when: arch_based and root_access - name: Install AUR package manager (Arch) aur: name: yay-bin - when: arch + when: arch and root_access - name: Install AUR package manager (Manjaro) pacman: name: yay - when: manjaro + become: yes + when: manjaro and root_access # Not sure if regular Manjaro has yay in its community packages, # but Manjaro-ARM sure does @@ -103,18 +97,7 @@ - name: Generate list of packages for package manager set_fact: - packages: "{{ query('template', 'package_manager.j2')[0].split('\n')[:-1]|sort }}" - tags: softwarelist - -- name: Install packages (Arch-based) - aur: - name: "{{ packages }}" - extra_args: "--asdeps" - # Nothing is set as installed manually so it can - # be removed by dependency check. - # Current packages will be kept by the meta package - use: yay - when: arch_based + packages: "{{ query('template', 'package_manager.j2')[0].split('\n')[:-1]|sort|unique }}" tags: softwarelist - name: Check if list of packages changed @@ -124,3 +107,13 @@ notify: "software changed" tags: softwarelist +- name: Install packages (Arch-based) + aur: + name: "{{ packages }}" + extra_args: "--asdeps --needed" + # Nothing is set as installed manually so it can + # be removed by dependency check. + # Current packages will be kept by the meta package + use: yay + tags: softwarelist + when: arch_based and root_access diff --git a/config/automatrop/roles/software/templates/package_manager.j2 b/config/automatrop/roles/software/templates/package_manager.j2 index 2648920..103a423 100644 --- a/config/automatrop/roles/software/templates/package_manager.j2 +++ b/config/automatrop/roles/software/templates/package_manager.j2 @@ -1,26 +1,48 @@ -{# Base shell packages #} -coreutils -bash -grep -sed -tar -openssl +{# Macros #} {% if debian_based %} -python3-pip -{% elsif termux %} -python +{% set python_prefix = 'python3' %} +{% set lib_suffix = '-common' %} {% else %} -python-pip +{% set python_prefix = 'python' %} +{% set lib_suffix = '' %} {% endif %} -{# Extended shell packages #} -moreutils -tmux -bash-completion -fzf -highlight -{% if arch_based %} -powerline-go-bin +{# Include essential snippets #} +{% include 'snippets/pm_dotfiles_dependencies.j2' %} +{% include 'snippets/pm_shell.j2' %} +{% include 'snippets/pm_terminal_essentials.j2' %} +{% include 'snippets/pm_remote.j2' %} +{% include 'snippets/pm_disk_cleanup.j2' %} +{% include 'snippets/pm_local_monitoring.j2' %} +{% include 'snippets/pm_mpd.j2' %} +{% include 'snippets/pm_multimedia_toolbox.j2' %} +{% include 'snippets/pm_multimedia_common.j2' %} +{% include 'snippets/pm_data_management.j2' %} +{# Include rules-determined snippets #} +{% if display_manager %} +{% include 'snippets/pm_desktop_environment.j2' %} +{% endif %} +{% if termux %} +{% include 'snippets/pm_termux.j2' %} {% else %} -powerline-go +{% include 'snippets/pm_noandroid.j2' %} {% endif %} -zsh +{% if software_full %} +{% include 'snippets/pm_android_tools.j2' %} +{% include 'snippets/pm_multimedia_editors.j2' %} +{% include 'snippets/pm_download.j2' %} +{% include 'snippets/pm_wine.j2' %} +{% include 'snippets/pm_document.j2' %} +{% endif %} +{# Inclde dev snippets #} +{% if dev_stuffs %} +{% include 'snippets/pm_dev_common.j2' %} +{% for dev_stuff in dev_stuffs %} +{% include 'snippets/pm_dev_' + dev_stuff + '.j2' %} +{% endfor %} +{% endif %} +{# Include custom snippets #} +{% for software_snippet in software_snippets %} +{% if software_snippet.startswith('pm_') %} +{% include 'snippets/' + software_snippet + '.j2' %} +{% endif %} +{% endfor %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 b/config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 new file mode 100644 index 0000000..3adfc83 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 @@ -0,0 +1,11 @@ +{# +Stuff for accessing Android phones +#} +{% if not termux %} +{% if arch_based %} +android-tools +android-udev +{% elif debian_based %} +adb +{% endif %} +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 b/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 new file mode 100644 index 0000000..75763f7 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 @@ -0,0 +1,12 @@ +{# +Stuff to synchronize/backup data +#} +rsync +borg +syncthing +{% if arch_based %} +{% if ansible_architecture == 'x86_64' %} +freefilesync-bin +{# Not worth the compilation if you can't have the binaries #} +{% endif %} +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 b/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 new file mode 100644 index 0000000..b7e1ed5 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 @@ -0,0 +1,66 @@ +firefox +pulseaudio +pacmixer +zbar +{% if arch_based %} +ttf-dejavu +ttf-twemoji +{% endif %} +{% if arch_based %} +xkb-qwerty-fr +{% endif %} +thunar +gedit +feh +zathura +{% if arch_based %} +zathura-pdf-mupdf +{% elif debian_based %} +zathura-pdf-poppler +{% endif %} +meld +{{ python_prefix }}-magic +{% if arch_based %} +yubikey-touch-detector +{% endif %} +{% if display_manager == "x11" %} +i3-wm +libgnomekbd{{ lib_suffix }} +dunst +i3lock +numlockx +rofi +{% if arch_based %} +rofimoji +{% endif %} +rxvt-unicode +{% if arch_based %} +urxvt-resize-font-git +alacritty +{% endif %} +scrot +simplescreenrecorder +trayer +unclutter +{% if arch_based %} +xautolock +{% endif %} +xclip +{% if arch_based %} +lemonbar-xft-git +wireless_tools +{% else %} +lemonbar +{% endif %} +autorandr +keynav +sct +xorg-xinit +{% if arch_based %} +xorg-xbacklight +{% elif debian_based %} +xbacklight +{% endif %} +{% elif display_manager == "wayland" %} +sway +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 new file mode 100644 index 0000000..c0a684d --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 @@ -0,0 +1,3 @@ +ansible +ansible-lint +{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 new file mode 100644 index 0000000..7353cb9 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 @@ -0,0 +1,10 @@ +{% if termux %} +{# Otherwise installed by base-devel or equivalent #} +make +gcc +{% endif %} +cmake +clang +ccache +gdb +{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 new file mode 100644 index 0000000..e334359 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 @@ -0,0 +1,11 @@ +perf +git +jq +{% if arch_based %} +ctags +{% elif debian_based %} +universal-ctags +{% endif %} +{% if not termux %} +highlight +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 new file mode 100644 index 0000000..012121f --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 @@ -0,0 +1,3 @@ +docker +docker-compose +{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 new file mode 100644 index 0000000..223a064 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 @@ -0,0 +1,6 @@ +yosys +iverilog +ghdl +{% if display_manager %} +gtkwave +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 new file mode 100644 index 0000000..fc3a6ab --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 @@ -0,0 +1,14 @@ +wget +curl +socat +{% if arch_based %} +bind +{% else %} +dnsutils +{% endif %} +whois +nmap +tcpdump +{% if display_manager %} +wireshark-qt +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 new file mode 100644 index 0000000..5d4fd42 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 @@ -0,0 +1,9 @@ +mypy +{% if not arch_based %} +black +{% endif %} +{% if arch_based %} +python-language-server +pyls-mypy +python-language-server-black +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 new file mode 100644 index 0000000..7cd054e --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 @@ -0,0 +1,2 @@ +bash-language-server +{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 b/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 new file mode 100644 index 0000000..24361ff --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 @@ -0,0 +1,13 @@ +{# +Program that essentially help you reduce disk usage +#} +jdupes +duperemove +optipng +{% if debian_based %} +libjpeg-turbo-progs +{% else %} +libjpeg-turbo +{% endif %} +reflac +{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_document.j2 b/config/automatrop/roles/software/templates/snippets/pm_document.j2 new file mode 100644 index 0000000..04baa13 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_document.j2 @@ -0,0 +1,27 @@ +{# Document utilities #} +pandoc +{% if arch_based %} +texlive-bibtexextra +texlive-core +texlive-fontsextra +texlive-formatsextra +texlive-latexextra +texlive-pictures +texlive-pstricks +texlive-science +{% elif debian_based %} +texlive-base +texlive-lang-european +{% endif %} +pdftk +{% if display_manager %} +{# Spell checking #} +hunspell-en_gb +hunspell-en_us +hunspell-fr +hunspell-nl +{# libreoffice-extension-grammalecte-fr #} +{% if arch_based %} +libreoffice-extension-languagetool +{% endif %} +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 b/config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 new file mode 100644 index 0000000..8aec48b --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 @@ -0,0 +1,22 @@ +{# +Stuff that is required for scripts/programs of dotfiles to work properly +#} +coreutils +bash +grep +sed +tar +openssl +git +wget +curl +{% if not termux %} +{{ python_prefix }}-pip +{# Termux already has pip via Python #} +{% endif %} +ansible +{# Uncompressors #} +unzip +unrar +p7zip +{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_download.j2 b/config/automatrop/roles/software/templates/snippets/pm_download.j2 new file mode 100644 index 0000000..d712aff --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_download.j2 @@ -0,0 +1,12 @@ +{# +Programs used to download sutff off the internet +#} +wget +curl +rsync +youtube-dl +megatools +transmission-cli +{% if display_manager %} +transmission-qt +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 b/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 new file mode 100644 index 0000000..b5a4dcc --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 @@ -0,0 +1,21 @@ +{# +Shell utilities to see what's going on on the system +#} +htop +{% if root_access %} +iotop +iftop +{% endif %} +ncdu +{% if not termux %} +lsof +{% endif %} +strace +pv +progress +{% if not termux %} +speedtest-cli +{% endif %} +{% if arch_based %} +pacman-contrib +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 b/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 new file mode 100644 index 0000000..f5744ea --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 @@ -0,0 +1,9 @@ +{# +To play music with Music Player Daemon +#} +mpd +mpc +{% if arch_based %} +ashuffle-git +vimpc-git +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 new file mode 100644 index 0000000..8d98b17 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 @@ -0,0 +1,13 @@ +{% if display_manager %} +gimp +inkscape +mpv +{% if arch_based %} +mpv-thumbnail-script +{% endif %} +{% if arch_based %} +libreoffice-fresh +{% elif debian_based %} +libreoffice +{% endif %} +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 new file mode 100644 index 0000000..7ffe13f --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 @@ -0,0 +1,12 @@ +{# +Big behemoth applications +#} +{% if display_manager %} +gimp +inkscape +darktable +blender +puddletag +musescore +audacity +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 new file mode 100644 index 0000000..9b8ba1b --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 @@ -0,0 +1,4 @@ +ffmpeg +sox +imagemagick +{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 b/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 new file mode 100644 index 0000000..b419634 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 @@ -0,0 +1,30 @@ +{# +Stuff that isn't required on Android because there are apps for that +#} +{# Password handling #} +pass +pwgen +{% if display_manager %} +rofi-pass +{# TODO Try autopass.cr #} +{% endif %} +{# Mail #} +isync +msmtp +notmuch +neomutt +lynx +{% if not arch_based %} +{# https://aur.archlinux.org/packages/tiv/#comment-812593 #} +tiv +{% endif %} +{% if display_manager %} +thunderbird +{% endif %} +{# Organisation #} +vdirsyncer +khard +khal +todoman +syncthing +{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_remote.j2 b/config/automatrop/roles/software/templates/snippets/pm_remote.j2 new file mode 100644 index 0000000..04d8a75 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_remote.j2 @@ -0,0 +1,6 @@ +openssh +wget +rsync +{% if display_manager %} +tigervnc +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_shell.j2 b/config/automatrop/roles/software/templates/snippets/pm_shell.j2 new file mode 100644 index 0000000..5a519a7 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_shell.j2 @@ -0,0 +1,21 @@ +{# +Shell related stuff +#} +{# ZSH #} +zsh +antigen +{% if arch_based %} +{# Antigen takex care of the above for others platforms #} +zsh-autosuggestions +zsh-completions +zsh-history-substring-search +zsh-syntax-highlighting +{% endif %} +tmux +bash-completion +fzf +{% if arch_based and ansible_architecture == 'x86_64' %} +powerline-go-bin +{% else %} +powerline-go +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 b/config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 new file mode 100644 index 0000000..813fc28 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 @@ -0,0 +1,21 @@ +moreutils +man +visidata +insect +translate-shell +{# Editor #} +{% if termux %} +nvim +{% else %} +neovim +{% endif %} +{% if not termux %} +{{ python_prefix }}-neovim +{% endif %} +{# Downloaders #} +wget +{# Uncompressors #} +unzip +unrar +p7zip +{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_termux.j2 b/config/automatrop/roles/software/templates/snippets/pm_termux.j2 new file mode 100644 index 0000000..8cc9822 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_termux.j2 @@ -0,0 +1,9 @@ +{# +Stuff that only makes sense on Termux +#} +{% if termux %} +{% if root_access %} +tsu +{% endif %} +termux-api +{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_wine.j2 b/config/automatrop/roles/software/templates/snippets/pm_wine.j2 new file mode 100644 index 0000000..410e64c --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_wine.j2 @@ -0,0 +1,11 @@ +{% if ansible_architecture == 'x86_64' %} +wine +{% if arch_based %} +wine-gecko +wine-mono +mono +lib32-libpulse +{% elif debian_based %} +mono-runtime +{% endif %} +{% endif %} diff --git a/config/scripts/common/installSoftware b/config/scripts/common/installSoftware index 8ca7866..34bd7d3 100755 --- a/config/scripts/common/installSoftware +++ b/config/scripts/common/installSoftware @@ -1,5 +1,7 @@ #!/usr/bin/env sh +# DEPRECATED + # set -x # Allows to install software diff --git a/config/scripts/softwareList b/config/scripts/softwareList index ec3ceb7..caf0974 100755 --- a/config/scripts/softwareList +++ b/config/scripts/softwareList @@ -1,5 +1,7 @@ #!/usr/bin/env sh +# DEPRECATED + # List of the software I use divided by categories. # Oh and it asks the category you want to install on # the running machine too.