From a13aa142567f2c29b0d2e05d75ffc8b71f508665 Mon Sep 17 00:00:00 2001 From: Tyler Starr Date: Sat, 14 Jan 2023 15:24:18 -0800 Subject: [PATCH] change to arch --- additional-setup.md | 20 +- ...pdate.tmpl => executable_arch-update.tmpl} | 2 +- home/bin/executable_void-doctor | 39 --- home/bin/executable_void-list-packages | 3 - home/bin/executable_void-xbps-description | 22 -- home/dot_config/i3/config.tmpl | 9 +- home/dot_zshrc | 5 - jumpstart.sh | 12 +- provision/library/yay | 272 ++++++++++++++++++ provision/setup.yml | 2 +- provision/tasks/desktop/packages.yml | 32 +-- provision/tasks/development/_main.yml | 4 +- provision/tasks/development/configs.yml | 5 - provision/tasks/development/packages.yml | 21 +- provision/tasks/engineering/packages.yml | 10 +- provision/tasks/engineering/superslicer.yml | 6 - provision/tasks/gaming/packages.yml | 8 +- .../tasks/include/download-github-archive.yml | 16 -- .../tasks/include/download-github-bin.yml | 16 -- provision/tasks/include/xbps-src.yml | 33 --- provision/tasks/system/configs.yml | 76 +---- provision/tasks/system/packages.yml | 35 ++- provision/tasks/terminal/advcpmv.yml | 29 -- provision/tasks/terminal/configs.yml | 1 - provision/tasks/terminal/nb.yml | 6 - provision/tasks/terminal/packages.yml | 23 +- provision/tasks/terminal/taskwarrior-tui.yml | 6 - readme.md | 10 +- 28 files changed, 364 insertions(+), 359 deletions(-) rename home/bin/{executable_void-update.tmpl => executable_arch-update.tmpl} (97%) delete mode 100644 home/bin/executable_void-doctor delete mode 100644 home/bin/executable_void-list-packages delete mode 100644 home/bin/executable_void-xbps-description create mode 100755 provision/library/yay delete mode 100644 provision/tasks/development/configs.yml delete mode 100644 provision/tasks/engineering/superslicer.yml delete mode 100644 provision/tasks/include/download-github-archive.yml delete mode 100644 provision/tasks/include/download-github-bin.yml delete mode 100644 provision/tasks/include/xbps-src.yml delete mode 100644 provision/tasks/terminal/advcpmv.yml delete mode 100644 provision/tasks/terminal/nb.yml delete mode 100644 provision/tasks/terminal/taskwarrior-tui.yml diff --git a/additional-setup.md b/additional-setup.md index d234ee10..9b83dbd3 100644 --- a/additional-setup.md +++ b/additional-setup.md @@ -1,6 +1,6 @@ # Additional Setup -The following documents Void setup that wasn't automated with ansible. +The following documents Arch setup that wasn't automated with ansible. ## Radicale and vdirsyncer for contacts/calendar @@ -88,21 +88,3 @@ taskopen). My GTK theme is pulled down by chezmoi, but isn't active by default. This can be fixed with the lxappearance gui. - -## Single GPU Passthrough with Windows - -Install libvirt hooks: - -```bash -sudo mkdir -p /etc/libvirt/hooks -sudo wget 'https://raw.githubusercontent.com/PassthroughPOST/VFIO-Tools/master/libvirt_hooks/qemu' \ - -O /etc/libvirt/hooks/qemu -sudo chmod +x /etc/libvirt/hooks/qemu -``` - -reboot.... - - -```bash - -``` diff --git a/home/bin/executable_void-update.tmpl b/home/bin/executable_arch-update.tmpl similarity index 97% rename from home/bin/executable_void-update.tmpl rename to home/bin/executable_arch-update.tmpl index c968b9e5..b1e2d296 100644 --- a/home/bin/executable_void-update.tmpl +++ b/home/bin/executable_arch-update.tmpl @@ -3,7 +3,7 @@ help () { echo " -Update void linux with ansible +Update arch linux with ansible Usage: update diff --git a/home/bin/executable_void-doctor b/home/bin/executable_void-doctor deleted file mode 100644 index 00ec4275..00000000 --- a/home/bin/executable_void-doctor +++ /dev/null @@ -1,39 +0,0 @@ -import yaml -import subprocess - -print("I'm the void doctor!") - -with open('/home/tstarr/.local/share/chezmoi/provision/tasks/desktop/packages.yml', 'r') as f: - in_yaml = yaml.safe_load(f) - -installed = subprocess.getoutput("xbps-query -m | sed 's!-[^-]*$!!'").split("\n") -installed.extend(subprocess.getoutput("flatpak list --columns=application").split("\n")) - -standard_keys = ["xbps", "flatpak"] -custom_keys = { "xbps-src": {"key": "include_tasks", "value": "xbps-src.yml"}} - -def parse_xbps_src(in_dict): - pack_list = [] - for item in in_dict["loop"]: - if "package" in item.keys(): - pack_list.append(item["package"]) - return pack_list - -packages = [] - -for item in in_yaml: - # Check standard for standard keys - for key in standard_keys: - if key in item.keys(): - packages.extend(item[key]["name"]) - - # Check custom if standard doesn't work - for key in custom_keys.keys(): - if custom_keys[key]["key"] in item.keys(): - if custom_keys[key]["value"] in item[custom_keys[key]["key"]]: - if key == "xbps": - packages.extend(parse_xbps_src(item)) - -not_ansible = [i for i in installed if i not in packages] -print("Installed, but not in ansible: ", not_ansible) - diff --git a/home/bin/executable_void-list-packages b/home/bin/executable_void-list-packages deleted file mode 100644 index 709dcdcd..00000000 --- a/home/bin/executable_void-list-packages +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -tmp=$(mktemp); xbps-query -m > ${tmp}; xilog | grep -f ${tmp}; /usr/bin/rm ${tmp} diff --git a/home/bin/executable_void-xbps-description b/home/bin/executable_void-xbps-description deleted file mode 100644 index c7f8fbb3..00000000 --- a/home/bin/executable_void-xbps-description +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/python - -import os -import subprocess -import sys - -input_str = sys.stdin.read().replace("\n", "") -pkg = input_str.replace(" ", "")[1:] -cmd = "xbps-query -Rs %s"%(pkg) -output = subprocess.getoutput(cmd) -if output.count('[') > 1: - cmd = "xbps-query -Rs %s | grep -E ' %s-[0-9](.|[0-9])[0-9]'"%(pkg,pkg) - output = subprocess.getoutput(cmd) -upper_pos = -1 -for index, char in enumerate(output): - if char == char.upper() and char.isalpha(): - upper_pos = index - break -if upper_pos == -1: - sys.stdout.write("error") -else: - sys.stdout.write(input_str + " # " + output[upper_pos:]) diff --git a/home/dot_config/i3/config.tmpl b/home/dot_config/i3/config.tmpl index 0ce11d1d..9abdf9c2 100644 --- a/home/dot_config/i3/config.tmpl +++ b/home/dot_config/i3/config.tmpl @@ -196,9 +196,9 @@ bindsym $mod+Shift+r move container to workspace $tag9 bindsym $mod+Shift+t move container to workspace $tag0 # audio -bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +2% -bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -2% -bindsym XF86AudioMute exec amixer -q set Master toggle +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2% +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2% +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle # [o]pen applications bindsym $mod+Return exec alacritty @@ -206,7 +206,7 @@ bindsym $mod+a exec rofi -show drun -show-icons bindsym $mod+Shift+a exec rofi -show window -show-icons bindsym $mod+o mode open mode open { - bindsym b exec flatpak run org.mozilla.firefox, $e + bindsym b exec firefox, $e bindsym s exec steam, $e bindsym d exec flatpak run com.discordapp.Discord, $e bindsym Escape mode default @@ -229,7 +229,6 @@ mode scratch { #------------------------------------------------------------------------------- exec --no-startup-id "autorandr --change && i3-msg restart" -exec --no-startup-id "pipewire & pipewire-pulse &" exec --no-startup-id "udiskie &" exec_always --no-startup-id "$HOME/.config/i3/scripts/polybar.sh" exec_always --no-startup-id "blueman-applet" diff --git a/home/dot_zshrc b/home/dot_zshrc index 9595e019..6a9e605e 100644 --- a/home/dot_zshrc +++ b/home/dot_zshrc @@ -116,11 +116,6 @@ alias cc="chezmoi cd" alias cdr="chezmoi apply --verbose --dry-run" alias ca="chezmoi apply" -# xbps -alias xi="sudo xbps-install" -alias xr="sudo xbps-remove" -alias xl="void-list-packages" - # trashcli alias rm='echo "This is not the command you are looking for."; false' alias tp='trash-put' diff --git a/jumpstart.sh b/jumpstart.sh index 7faee291..522abf91 100755 --- a/jumpstart.sh +++ b/jumpstart.sh @@ -2,15 +2,21 @@ echo -e "Starting initial setup..." -CHEZDIR="/home/test/.local/share/chezmoi" +CHEZDIR="/home/tstarr/.local/share/chezmoi" echo "Input email for bitwarden:" read bitemail # Install ansible python dependencies -sudo xbps-install -Syu -y -sudo xbps-install python3 python3-pip ansible -y +sudo pacman -Syu +sudo pacman -S git chezmoi python python-pip ansible base-devel sudo pip install pexpect +# Install yay +git clone https://aur.archlinux.org/yay.git ~/tmp/yay +cd ~/tmp/yay +makepkg -si +cd - + # Install ansible extensions ansible-galaxy install -r "$CHEZDIR/provision/requirements.yml" diff --git a/provision/library/yay b/provision/library/yay new file mode 100755 index 00000000..397903fa --- /dev/null +++ b/provision/library/yay @@ -0,0 +1,272 @@ +#!/usr/local/bin/python + +# The MIT License (MIT) +# +# Copyright (c) 2014 Austin Hyde +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +def yay_in_path(module): + rc, _, _ = module.run_command('which yay', check_rc=False) + return rc == 0 + + +def pacman_in_path(module): + rc, _, _ = module.run_command('which pacman', check_rc=False) + return rc == 0 + +def get_version(yay_output): + '''Take yay -Qi or yay -Si output and get the Version''' + lines = yay_output.split('\n') + for line in lines: + if 'Version' in line: + return line.split(':')[1].strip() + return None + +def query_package(module, pkg, state): + ''' + Query the package status in both the local system and the repository. + Returns three booleans to indicate: + * If the package is installed + * If the package is up-to-date + * Whether online information was available + ''' + local_check_cmd = 'yay -Qi %s' % pkg + local_check_rc, local_check_stdout, _ = module.run_command(local_check_cmd, check_rc=False) + if local_check_rc != 0: + return False, False, False + + # No need to check for the repo version in some situations + # Indicate the package is out-of-date, because we chose not to check + if state == 'present' or state == 'absent': + return True, False, False + + local_version = get_version(local_check_stdout) + + repo_check_cmd = 'yay -Si %s' % pkg + repo_check_rc, repo_check_stdout, repo_check_stderr = module.run_command(repo_check_cmd, check_rc=False) + repo_version = get_version(repo_check_stdout) + + if repo_check_rc == 0 and repo_check_stderr == '': + return True, (local_version == repo_version), False + else: + # Indicate package is up-to-date, but just because we hit an error contacting the repo + return True, True, True + +def update_package_db(module): + rc, _, stderr = module.run_command('yay -Sy', check_rc=False) + + if rc == 0 and stderr == '': + return False, 'Package DB up-to-date' + elif rc == 1 and stderr == '': + return True, 'Updated the package DB' + else: + module.fail_json(msg='could not update package db: %s' % stderr) + +def upgrade(module): + check_rc, check_stdout, check_stderr = module.run_command('yay -Qqu', check_rc=False) + + if check_rc == 0 and check_stderr == '' and module.check_mode: + return True, '%s package(s) would be upgraded' % (len(check_stdout.split('\n')) - 1) + elif check_rc == 0 and check_stderr == '' and not module.check_mode: + upgrade_rc, _, upgrade_stderr = module.run_command( + 'yay -Su --noconfirm', + check_rc=False, + ) + + if upgrade_rc == 0: + return True, 'System upgraded' + else: + module.fail_json(msg='unable to upgrade: %s' % upgrade_stderr) + elif check_rc == 1 and check_stderr == '': + return False, 'Nothing to upgrade' + else: + module.fail_json(msg='unable to check for upgrade: %s' % check_stderr) + +def get_sudo_user(module): + # ansible sets the SUDO_USER environment variable. Default to using this, + # checking USER and then `logname` as backups. + user = os.environ.get('SUDO_USER') + + # If ansible is run as root with become_user set, use the specified user + # instead of root. + if not user or user == 'root': + user = os.environ.get('USER') + + if not user: + rc, stdout, _ = module.run_command('logname', check_rc=True) + user = stdout + + return user + +def check_packages(module, pkgs, state): + would_be_changed = [] + + for pkg in pkgs: + installed, updated, _ = query_package(module, pkg, state) + if ((state in ['present', 'latest'] and not installed) or + (state == 'latest' and not updated) or + (state == 'absent' and installed)): + would_be_changed.append(pkg) + + word = 'installed' + if state == 'absent': + word = 'removed' + + if would_be_changed: + return True, '%s package(s) would be %s' % (len(would_be_changed), word) + else: + return False, 'All packages are already %s' % word + +def install_packages(module, pkgs, state): + num_installed = 0 + package_err = [] + message = '' + + sudo_user = get_sudo_user(module) + cmd = 'sudo -u %s yay --noconfirm -S %s' + + for pkg in pkgs: + installed, updated, latest_error = query_package(module, pkg, state) + if latest_error and state == 'latest': + package_err.append(pkg) + + if installed and (state == 'present' or (state == 'latest' and updated)): + continue + + rc, _, stderr = module.run_command(cmd % (sudo_user, pkg), check_rc=False) + + if rc != 0: + module.fail_json(msg='Failed to install package %s, because: %s' % (pkg, stderr)) + + num_installed += 1 + + if state == 'latest' and len(package_err) > 0: + message = 'But could not ensure "latest" state for %s package(s) as remote version could not be fetched.' % package_err + + if num_installed > 0: + return True, 'Installed %s package(s). %s' % (num_installed, message) + else: + return False, 'All packages were already installed. %s' % message + +def remove_packages(module, pkgs, recurse, state): + num_removed = 0 + + arg = 'R' + word = 'remove' + if recurse: + arg = 'Rs' + word = 'recursively remove' + + cmd = 'pacman -%s --noconfirm %s' + + for pkg in pkgs: + installed, _, _ = query_package(module, pkg, state) + if not installed: + continue + + rc, _, stderr = module.run_command(cmd % (arg, pkg), check_rc=False) + + if rc != 0: + module.fail_json(msg='failed to %s package %s because: %s' % (word, pkg, stderr)) + + num_removed += 1 + + if num_removed > 0: + return True, 'Removed %s package(s)' % num_removed + else: + return False, 'All packages were already removed' + + +def main(): + module = AnsibleModule( + argument_spec = dict( + name = dict(type='list'), + state = dict( + default='present', + choices=['absent', 'present', 'latest'], + ), + recurse = dict(default='no', type='bool'), + upgrade = dict(default='no', type='bool'), + update_cache = dict( + default='no', + aliases=['update-cache'], + type='bool', + ), + ), + required_one_of = [['name', 'update_cache', 'upgrade']], + supports_check_mode = True + ) + + if not yay_in_path(module): + module.fail_json(msg="could not locate yay executable") + + if not pacman_in_path(module): + module.fail_json(msg="could not locate pacman executable") + + p = module.params + + changed = False + messages = [] + if p["update_cache"] and not module.check_mode: + updated, update_message = update_package_db(module) + changed = changed or updated + messages.append(update_message) + + if p['update_cache'] and module.check_mode: + changed = True + messages.append('Would have updated the package cache') + + if p['upgrade']: + upgraded, upgrade_message = upgrade(module) + changed = changed or upgraded + messages.append(upgrade_message) + + if p['name'] and module.check_mode: + packages_would_change, check_message = check_packages( + module, + p['name'], + p['state'], + ) + changed = changed or packages_would_change + messages.append(check_message) + elif p['name'] and not module.check_mode: + if p['name']: + if p['state'] in ['present', 'latest']: + packages_changed, package_message = install_packages( + module, + p['name'], + p['state'], + ) + elif p['state'] == 'absent': + packages_changed, package_message = remove_packages( + module, + p['name'], + p['recurse'], + p['state'], + ) + + changed = changed or packages_changed + messages.append(package_message) + + module.exit_json(changed=changed, msg='. '.join(messages)) + + +from ansible.module_utils.basic import * +main() diff --git a/provision/setup.yml b/provision/setup.yml index 9fcc36d0..c6c69115 100644 --- a/provision/setup.yml +++ b/provision/setup.yml @@ -1,4 +1,4 @@ -- name: Ansible playbook to setup void linux +- name: Ansible playbook to setup arch linux hosts: all vars_files: diff --git a/provision/tasks/desktop/packages.yml b/provision/tasks/desktop/packages.yml index e0c4aa21..6f3226dc 100644 --- a/provision/tasks/desktop/packages.yml +++ b/provision/tasks/desktop/packages.yml @@ -1,47 +1,43 @@ -- name: Install desktop void packages - xbps: +- name: Install desktop arch packages + pacman: name: - xorg # X.org meta-package + - xorg-xinit - xterm # X Terminal Emulator - alacritty # Cross-platform, GPU-accelerated terminal emulator - mpv # Video player based on MPlayer/mplayer2 - - python3-i3ipc # Improved Python library to control i3wm and sway - - xprop # Property displayer for X + - python-i3ipc # Improved Python library to control i3wm and sway - lxappearance # LXDE Theme Switcher - blueman # GTK+ Bluetooth Manager - - xrandr # Primitive command line interface to RandR extension - dunst # Lightweight and customizable notification daemon - ffmpeg # Decoding, encoding and streaming software - i3 # Improved tiling window manager - i3status # Status bar generator for i3bar, dzen2, xmobar or similar programs - nitrogen # Background browser and setter for X with support for Xinerama - - nvidia # NVIDIA drivers for linux - Libraries and Utilities - - nvidia-libs-32bit # NVIDIA drivers for linux - common libraries (32bit) + - nvidia-dkms # NVIDIA drivers for linux - Libraries and Utilities + - lib32-nvidia-utils # NVIDIA drivers for linux - common libraries (32bit) - pavucontrol # PulseAudio Volume Control - polybar # Fast and easy-to-use status bar - rofi # Window switcher, run dialog and dmenu replacement - pcmanfm # LXDE file manager - - xclip # Command line interface to the X11 clipboard - autorandr # Automatically select a display configuration based on connected devices - - xsel # Command-line getting and setting the contents of the X selection - clipmenu # Clipboard management using dmenu - - nerd-fonts # Iconic font aggregator, collection and patcher - - xdotool # Command-line X11 automation tool - flameshot # Powerful yet simple to use screenshot software for GNU/Linux + - firefox 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 aur packages + yay: + name: + - rofi-rbw # Simplistic password typer/copier using rofi and wofi + - nerd-fonts-complete + state: present + become: true - name: Install desktop flatpaks flatpak: name: - - org.mozilla.firefox # Mozilla Firefox web browser - com.discordapp.Discord # VoIP and instant messaging social platform - org.gimp.GIMP # Create images and edit photographs - org.inkscape.Inkscape # Vector Graphics Editor diff --git a/provision/tasks/development/_main.yml b/provision/tasks/development/_main.yml index 3ee4a789..68d12ab3 100644 --- a/provision/tasks/development/_main.yml +++ b/provision/tasks/development/_main.yml @@ -1,4 +1,2 @@ -- import_tasks: configs.yml - tags: ["configs"] - import_tasks: packages.yml - tags: ["packages"] \ No newline at end of file + tags: ["packages"] diff --git a/provision/tasks/development/configs.yml b/provision/tasks/development/configs.yml deleted file mode 100644 index 50da50e7..00000000 --- a/provision/tasks/development/configs.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Setup nvm - tags: ["once"] - shell: > - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash - creates=/home/{{ user }}/.nvm/nvm.sh diff --git a/provision/tasks/development/packages.yml b/provision/tasks/development/packages.yml index 38c2ce07..28a7d76a 100644 --- a/provision/tasks/development/packages.yml +++ b/provision/tasks/development/packages.yml @@ -1,14 +1,21 @@ -- name: Install development void packages - xbps: +- name: Install development arch packages + pacman: name: - - python3 # Python programming language (3.11 series) - - python3-pip # A tool for installing and managing Python3 packages + - python # Python programming language (3.11 series) + - python-pip # A tool for installing and managing Python3 packages + - python-setuptools - 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 - - ruby-tmuxinator # Create and manage complex tmux sessions easily - - python3-pipenv # Python Development Workflow for Humans - - python3-devel # Python programming language (3.11 series) - development files + - python-pipenv # Python Development Workflow for Humans + state: present + become: true + +- name: Install development aur packages + yay: + name: + - tmuxinator # Create and manage complex tmux sessions easily + - nvm state: present become: true diff --git a/provision/tasks/engineering/packages.yml b/provision/tasks/engineering/packages.yml index b240c5fb..73766931 100644 --- a/provision/tasks/engineering/packages.yml +++ b/provision/tasks/engineering/packages.yml @@ -1,8 +1,12 @@ -- name: Install engineering void packages - xbps: +- name: Install engineering arch packages + pacman: name: - freecad # General purpose 3D CAD modeler state: present become: true -- include_tasks: superslicer.yml # PrusaSlicer fork (which is a slic3r fork) +- name: Install engineering aur packages + yay: + name: + - superslicer-bin # PrusaSlicer fork (which is a slic3r fork) + become: true diff --git a/provision/tasks/engineering/superslicer.yml b/provision/tasks/engineering/superslicer.yml deleted file mode 100644 index 583ba256..00000000 --- a/provision/tasks/engineering/superslicer.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: Install SuperSlicer - include_tasks: ../include/download-github-bin.yml - loop: - - user: supermerill - repo: SuperSlicer - regex: "SuperSlicer-ubuntu_18.04-[0-9]" diff --git a/provision/tasks/gaming/packages.yml b/provision/tasks/gaming/packages.yml index ccbf76d2..26dd3af2 100644 --- a/provision/tasks/gaming/packages.yml +++ b/provision/tasks/gaming/packages.yml @@ -1,10 +1,6 @@ -- name: Install gaming void packages - xbps: +- name: Install gaming arch packages + pacman: name: - - libdrm-32bit # Userspace interface to kernel DRM services (32bit) - - libgcc-32bit # GNU Compiler Collection - GCC library (32bit) - - libstdc++-32bit # GNU Compiler Collection - Standard C++ Library (32bit) - - mesa-dri-32bit # Mesa DRI drivers (32bit) - steam # Launcher for the Steam software distribution service - lutris # Video game preservation platform - gamemode # Optimize system performance for games on demand diff --git a/provision/tasks/include/download-github-archive.yml b/provision/tasks/include/download-github-archive.yml deleted file mode 100644 index eb14e9e3..00000000 --- a/provision/tasks/include/download-github-archive.yml +++ /dev/null @@ -1,16 +0,0 @@ -- name: Get {{ item.repo }} release information - uri: - url: https://api.github.com/repos/{{ item.user }}/{{ item.repo }}/releases/latest - return_content: true - register: repo_latest - -- name: Install archived {{ item.repo }} - {{ repo_latest.json.tag_name }} - loop: "{{ repo_latest.json.assets }}" - when: "asset.name is regex(item.regex)" - unarchive: - src: "{{ asset.browser_download_url }}" - dest: /usr/local/bin - remote_src: true - loop_control: - loop_var: asset - become: true diff --git a/provision/tasks/include/download-github-bin.yml b/provision/tasks/include/download-github-bin.yml deleted file mode 100644 index cfc909c0..00000000 --- a/provision/tasks/include/download-github-bin.yml +++ /dev/null @@ -1,16 +0,0 @@ -- name: Get {{ item.repo }} release information - uri: - url: https://api.github.com/repos/{{ item.user }}/{{ item.repo }}/releases/latest - return_content: true - register: repo_latest - -- name: Install un-archived {{ item.repo }} - {{ repo_latest.json.tag_name }} - loop: "{{ repo_latest.json.assets }}" - when: "asset.name is regex(item.regex)" - get_url: - url: "{{ asset.browser_download_url }}" - dest: /usr/local/bin/{{ item.repo }} - mode: 0775 - loop_control: - loop_var: asset - become: true diff --git a/provision/tasks/include/xbps-src.yml b/provision/tasks/include/xbps-src.yml deleted file mode 100644 index 4892b389..00000000 --- a/provision/tasks/include/xbps-src.yml +++ /dev/null @@ -1,33 +0,0 @@ -- name: Clone or pull void-packages - ansible.builtin.git: - repo: 'https://github.com/starr-dusT/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 diff --git a/provision/tasks/system/configs.yml b/provision/tasks/system/configs.yml index 2703a629..87955d79 100644 --- a/provision/tasks/system/configs.yml +++ b/provision/tasks/system/configs.yml @@ -14,80 +14,14 @@ mode: 0775 become: true -- name: Set git username and email - shell: | - git config --global user.email {{ git_email }} - git config --global user.name {{ git_user }} - -- name: Stop system services - shell: | - rm -R /var/service/dhcpcd - ignore_errors: true - become: true - -- name: Start system services - shell: | - ln -s /etc/sv/dbus /var/service - ln -s /etc/sv/polkitd /var/service - ln -s /etc/sv/bluetoothd /var/service - ln -s /etc/sv/sshd /var/service - ln -s /etc/sv/libvirtd /var/service - ln -s /etc/sv/virtlockd /var/service - ln -s /etc/sv/virtlogd /var/service - ln -s /etc/sv/NetworkManager /var/service - ignore_errors: true - become: true - - name: Add {{ user }} to libvirt group shell: | gpasswd -a {{ user }} libvirt become: true -- name: Setup user services - block: - - name: Create user folder - file: - path: /etc/sv/{{ user }} - state: directory - - - name: Create user service file - copy: - dest: /etc/sv/{{ user }}/run - content: | - #!/bin/sh - USER="{{ user }}" - GROUPS="$(id -Gn "$USER" | tr ' ' ':')" - SVDIR="/home/${USER}/.service" - if [ -d ${SVDIR} ]; then - chpst -u"${USER}:${GROUPS}" runsvdir ${SVDIR} - fi - mode: 0755 - - - name: Enable user services - shell: | - ln -s /etc/sv/{{ user }} /var/service - ignore_errors: true - become: true - -- name: Ensure user services folder exists - file: - path: /home/{{ user }}/.service - state: directory - mode: 0755 - - name: Start syncthing as {{ user }} - block: - - name: Create syncthing folder - file: - path: /home/{{ user }}/.service/syncthing - state: directory - mode: 0755 - - - name: Create synthing run file - copy: - dest: /home/{{ user }}/.service/syncthing/run - content: | - #!/bin/sh - export HOME=/home/{{ user }}/ - exec /usr/bin/syncthing > /dev/null 2>&1 - mode: 0755 + service: + name: syncthing@{{ user }} + state: started + enabled: yes + become: true diff --git a/provision/tasks/system/packages.yml b/provision/tasks/system/packages.yml index 2ffa8856..08459a82 100644 --- a/provision/tasks/system/packages.yml +++ b/provision/tasks/system/packages.yml @@ -1,32 +1,23 @@ -- name: Install system void repos - xbps: - name: - - void-repo-multilib # Void Linux drop-in file for the multilib repository - - void-repo-multilib-nonfree # Void Linux drop-in file for the multilib/nonfree repository - - void-repo-nonfree # Void Linux drop-in file for the nonfree repository - state: present - become: true - -- name: Install system void packages - xbps: +- name: Install system arch packages + pacman: name: + - linux + - linux-zen + - linux-headers + - linux-zen-headers - git # Fast Version Control System - git-lfs # Git extension for versioning large files - syncthing # Continuous File Synchronization - flatpak # Application deployment framework for desktop apps - - wireguard # Fast, modern, secure vpn tunnel - wireguard-tools # Tool for wireguard - cronie # Runs specified programs at scheduled times - pipewire # Server and user space API to deal with multimedia pipelines - - libspa-bluetooth # Server and user space API to deal with multimedia pipelines - bluetooth plugins + #- libspa-bluetooth # Server and user space API to deal with multimedia pipelines - bluetooth plugins - cifs-utils # CIFS filesystem user-space tools - ansible # Simple deployment, configuration management and execution framework - - btrbk # Backup tool for btrfs subvolumes - chezmoi # Manage your dotfiles across multiple machines, securely - - elogind # Standalone logind fork - rsync # Remote fast incremental file transfer tool - unzip # List, test and extract compressed files in a ZIP archive - - mimeo # Open files by MIME-type or file name using regular expressions - busybox # Swiss Army Knife of Embedded Linux - qemu # Open Source Processor Emulator - libvirt # Virtualization API for controlling virtualization engines @@ -36,11 +27,19 @@ - udiskie # Removable disk automounter using udisks - curl # Client that groks URLs - wget # GNU wget download utility - - NetworkManager # Network Management daemon + - networkmanager # Network Management daemon - network-manager-applet # NetworkManager panel applet for GNOME - psensor # Graphical hardware temperature monitor for Linux - upower # Abstraction for enumerating power devices - - android-udev-rules # Android udev rules list aimed to be the most comprehensive on the net + - android-udev # Android udev rules list aimed to be the most comprehensive on the net + state: present + become: true + +- name: Install system aur packages + yay: + name: + - mimeo # Open files by MIME-type or file name using regular expressions + - btrbk # Backup tool for btrfs subvolumes state: present become: true diff --git a/provision/tasks/terminal/advcpmv.yml b/provision/tasks/terminal/advcpmv.yml deleted file mode 100644 index b3871793..00000000 --- a/provision/tasks/terminal/advcpmv.yml +++ /dev/null @@ -1,29 +0,0 @@ -- name: Make advcpmv directory - file: - path: /home/{{ user }}/tmp/advcpmv - state: directory - -- name: Download advcpmv file - ansible.builtin.get_url: - url: https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh - dest: /home/{{ user }}/tmp/advcpmv/install.sh - -- name: Compile advcp and advmv - command: - cmd: sh /home/{{ user }}/tmp/advcpmv/install.sh - creates: /home/{{ user }}/tmp/advcpmv/advcp - chdir: /home/{{ user }}/tmp/advcpmv - -- name: Move advcp - copy: - src: /home/{{ user }}/tmp/advcpmv/advcp - dest: /usr/local/bin/cpg - mode: preserve - become: true - -- name: Move advmv - copy: - src: /home/{{ user }}/tmp/advcpmv/advmv - dest: /usr/local/bin/mvg - mode: preserve - become: true diff --git a/provision/tasks/terminal/configs.yml b/provision/tasks/terminal/configs.yml index 2bed2f40..53e6ea71 100644 --- a/provision/tasks/terminal/configs.yml +++ b/provision/tasks/terminal/configs.yml @@ -4,7 +4,6 @@ shell: /bin/zsh become: true - - name: Set rbw email shell: | rbw config set email {{ bitwarden_email }} diff --git a/provision/tasks/terminal/nb.yml b/provision/tasks/terminal/nb.yml deleted file mode 100644 index fd296970..00000000 --- a/provision/tasks/terminal/nb.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: Install nb - ansible.builtin.get_url: - url: https://raw.github.com/xwmx/nb/master/nb - dest: /usr/local/bin/nb - mode: 0755 - become: true diff --git a/provision/tasks/terminal/packages.yml b/provision/tasks/terminal/packages.yml index 4f7a00c6..86600bfb 100644 --- a/provision/tasks/terminal/packages.yml +++ b/provision/tasks/terminal/packages.yml @@ -1,9 +1,10 @@ -- name: Install terminal void packages - xbps: +- name: Install terminal arch packages + pacman: name: - neovim # Vim-fork focused on extensibility and agility - task # Command-line TODO list manager - - timewarrior # Timewarrior tracks and reports time + - timew # Timewarrior tracks and reports time + - taskwarrior-tui - vifm # Ncurses-based file manager with vi-like keybindings - zsh # Z SHell - tmux # Terminal Multiplexer @@ -17,12 +18,10 @@ state: present become: true -- 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 - -- include_tasks: nb.yml # Command line and local web note‑taking, bookmarking, archiving, and knowledge base application -- include_tasks: taskwarrior-tui.yml # Terminal User Interface (TUI) for Taskwarrior +- name: Install terminal aur packages + yay: + name: + - rbw + - nb + state: present + become: true diff --git a/provision/tasks/terminal/taskwarrior-tui.yml b/provision/tasks/terminal/taskwarrior-tui.yml deleted file mode 100644 index 3e8a3c23..00000000 --- a/provision/tasks/terminal/taskwarrior-tui.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: Install taskwarrior-tui - include_tasks: ../include/download-github-archive.yml - loop: - - user: kdheepak - repo: taskwarrior-tui - regex: unknown-linux-gnu.tar.gz diff --git a/readme.md b/readme.md index a9c18b3a..6a638300 100644 --- a/readme.md +++ b/readme.md @@ -5,15 +5,15 @@ My personal dotfiles repo. Documentation is pretty spotty. Maybe I'll fix that s ## Usage -Dotfiles are managed with chezmoi and Ansible (built for Void) is used for the bulk of configuration. +Dotfiles are managed with chezmoi and Ansible (built for Arch) is used for the bulk of configuration. ## Initial Setup -Install Void with BTRFS and run the following commands: +Install Arch with BTRFS and run the following commands: ```bash -sudo xbps-install -Syu -y -sudo xbps-install -S vim git chezmoi -y +sudo pacman -Syu +sudo pacman -S vim git chezmoi git clone https://github.com/starr-dusT/dotfiles ~/.local/share/chezmoi ``` @@ -29,4 +29,4 @@ Perform additional setup found in [additional-setup](additional-setup.md) ## Update Setup -`void-update` command updates the system with ansible. Run `void-update -h` for information on usage. +`arch-update` command updates the system with ansible. Run `arch-update -h` for information on usage.