setup xbps-src packaging and update script to allow skipping them

This commit is contained in:
Tyler Starr 2022-12-29 00:48:31 -08:00
parent f983d68dd9
commit 9ad14d05ff
8 changed files with 103 additions and 28 deletions

View File

@ -1,9 +1,11 @@
#!/usr/bin/env sh
set -e
echo -e "Starting initial setup for Fedora..."
#!/usr/bin/env bash
# Install ansible and run playbook
sudo dnf -y update && sudo dnf install -y ansible
echo -e "Starting initial setup..."
# Install ansible python dependencies
sudo xpbs-install -Syu
sudo xbps-install python3 python3-pip ansible
sudo pip install pexpect
# Install ansible extensions
ansible-galaxy install -r {{ .chezmoi.workingTree }}/provision/requirements.yml
@ -19,7 +21,7 @@ read -p "Reboot? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
exit 0
fi
sudo reboot

View File

@ -1,13 +1,56 @@
#!/usr/bin/env sh
# provide tags to update with comma seperation (e.g. updates,packages)
set -e
echo "Starting update for Void..."
#!/usr/bin/env bash
help ()
{
echo "
Update void linux with ansible
Usage: update <tags> <flags>
EXAMPLE TAGS:
packages,configs
FLAGS:
-s, --src compile (or recompile) source based packages"
exit 0
}
POSITIONAL_ARGS=()
SRC=false
while [[ $# -gt 0 ]]; do
case $1 in
-s|--src)
SRC=true
shift
;;
-h|--help)
help
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1")
shift
;;
esac
done
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
# Goto playbook and run it
cd {{ .chezmoi.workingTree }}/provision
# Install ansible and run playbook
if [ "$SRC" = true ] ; then
echo "Starting update with source packages - be prepated to wait..."
ansible-playbook setup.yml -i hosts --ask-become-pass --tags "$1" --skip-tags "once"
else
echo "Starting update without source packages..."
ansible-playbook setup.yml -i hosts --ask-become-pass --tags "$1" --skip-tags "once,src"
fi
# Return to where you were
cd -

View File

@ -30,17 +30,20 @@
state: present
become: true
- name: Install desktop xbps-src packages
tags: ["src"]
include_tasks: ../include/xbps-src.yml
loop:
- package: rofi-rbw # Simplistic password typer/copier using rofi and wofi
repository: hostdir/binpkgs
- name: Install desktop flatpaks
flatpak:
name:
- com.discordapp.Discord # Voice, video and text communication service
- com.discordapp.Discord # VoIP and instant messaging social platform
- org.gimp.GIMP # Create images and edit photographs
- org.inkscape.Inkscape # Vector Graphics Editor
- com.github.tchx84.Flatseal # Manage Flatpak permissions
state: present
become: true
- name: Install desktop python packages
ansible.builtin.pip:
name:
- rofi-rbw # Rofi frontend for Bitwarden

View File

@ -6,7 +6,6 @@
- ripgrep # Fast search tool inspired by ag and grep
- fd # Simple, fast and user-friendly alternative to find
- lazygit # Simple terminal UI for git commands
- cargo # Rust package manager
state: present
become: true

View File

@ -0,0 +1,33 @@
- name: Clone or pull void-packages
ansible.builtin.git:
repo: 'https://github.com/void-linux/void-packages.git'
dest: /home/{{ user }}/git/void-packages
update: yes
register: git_return
- name: Bootstrap if newly cloned
ansible.builtin.command: ./xbps-src binary-bootstrap
args:
chdir: /home/{{ user }}/git/void-packages
when: not git_return.before
- name: Enable restricted if newly cloned
copy:
dest: /home/{{ user }}/git/void-packages/etc/conf
content: |
XBPS_ALLOW_RESTRICTED=yes
when: not git_return.before
- name: Package {{ item.package }} with xbps-src
ansible.builtin.command: ./xbps-src pkg {{ item.package }}
args:
chdir: /home/{{ user }}/git/void-packages
- name: Install packaged {{ item.package }}
expect:
command: xbps-install --repository {{ item.repository }} {{ item.package }}
responses:
continue: y
args:
chdir: /home/{{ user }}/git/void-packages
become: true

View File

@ -37,4 +37,3 @@
state: present
flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo
become: true

View File

@ -13,10 +13,12 @@
- khal # Command-line calendar build around CalDAV
- khard # Command-line addressbook built around CardDAV
- vdirsyncer # Synchronize calendars and addressbooks
- cargo # Required for rbw
state: present
become: true
- name: Install rbw
community.general.cargo:
name: rbw # Unofficial command line client for Bitwarden
- name: Install terminal xbps-src packages
tags: ["src"]
include_tasks: ../include/xbps-src.yml
loop:
- package: rbw # Unofficial command line client for bitwarden
repository: hostdir/binpkgs

View File

@ -86,12 +86,6 @@ export HOME=/home/tstarr/
exec /usr/bin/syncthing > /dev/null 2>&1
```
## OH-my-zsh
```bash
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
## Lxappearance
GTK theme can be set with lxappearance