Added Paru
This commit is contained in:
@@ -6,6 +6,11 @@
|
|||||||
{{- $editor := promptBoolOnce . "features.editor" "Do you want to install Neovim" true }}
|
{{- $editor := promptBoolOnce . "features.editor" "Do you want to install Neovim" true }}
|
||||||
{{- $nix := promptBoolOnce . "features.editor" "Do you want to install the Nix package manager" true }}
|
{{- $nix := promptBoolOnce . "features.editor" "Do you want to install the Nix package manager" true }}
|
||||||
|
|
||||||
|
{{- $paru := false -}}
|
||||||
|
{{ if eq .chezmoi.osRelease.id "arch" -}}
|
||||||
|
{{- $paru = promptBoolOnce . "features.editor" "Do you want to install the Paru package manager" true -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
[data]
|
[data]
|
||||||
email = {{ $email | quote }}
|
email = {{ $email | quote }}
|
||||||
git_name = {{ $git_name | quote }}
|
git_name = {{ $git_name | quote }}
|
||||||
@@ -15,3 +20,4 @@ shell = {{ $shell }}
|
|||||||
git = {{ $git }}
|
git = {{ $git }}
|
||||||
editor = {{ $editor }}
|
editor = {{ $editor }}
|
||||||
nix = {{ $nix }}
|
nix = {{ $nix }}
|
||||||
|
paru = {{ $paru }}
|
||||||
|
|||||||
@@ -14,3 +14,7 @@
|
|||||||
{{- if not .features.nix }}
|
{{- if not .features.nix }}
|
||||||
.config/nix
|
.config/nix
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if not .features.paru }}
|
||||||
|
.config/paru
|
||||||
|
{{- end }}
|
||||||
|
|||||||
18
home/private_dot_config/paru/paru.conf
Normal file
18
home/private_dot_config/paru/paru.conf
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[options]
|
||||||
|
# Reverse sort order of search results
|
||||||
|
BottomUp
|
||||||
|
|
||||||
|
# Remove makedeps unconditionally after install
|
||||||
|
RemoveMake
|
||||||
|
|
||||||
|
# Refresh sudo timestamp to avoid sudo re-prompts
|
||||||
|
SudoLoop
|
||||||
|
|
||||||
|
# Skip review of build files
|
||||||
|
SkipReview
|
||||||
|
|
||||||
|
# Remove build files after install
|
||||||
|
CleanAfter
|
||||||
|
|
||||||
|
# Show a menu to select packages during upgrades
|
||||||
|
UpgradeMenu
|
||||||
@@ -31,3 +31,5 @@
|
|||||||
when: features.editor == true
|
when: features.editor == true
|
||||||
- role: nix
|
- role: nix
|
||||||
when: features.nix == true
|
when: features.nix == true
|
||||||
|
- role: paru
|
||||||
|
when: chezmoi.osRelease.id == "arch" and features.paru == true
|
||||||
|
|||||||
50
setup-script/roles/paru/tasks/main.yml
Normal file
50
setup-script/roles/paru/tasks/main.yml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
- name: Ensure build prerequisites are present
|
||||||
|
become: true
|
||||||
|
ansible.builtin.pacman:
|
||||||
|
name:
|
||||||
|
- base-devel
|
||||||
|
- fakeroot
|
||||||
|
|
||||||
|
- name: Create temporary dir for build
|
||||||
|
ansible.builtin.tempfile:
|
||||||
|
state: directory
|
||||||
|
suffix: paru
|
||||||
|
register: paru_tmp
|
||||||
|
|
||||||
|
- name: Download the AUR snapshot
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: "https://aur.archlinux.org/cgit/aur.git/snapshot/paru-bin.tar.gz"
|
||||||
|
dest: "{{ paru_tmp.path }}/paru-bin.tar.gz"
|
||||||
|
|
||||||
|
- name: Extract the snapshot
|
||||||
|
ansible.builtin.unarchive:
|
||||||
|
src: "{{ paru_tmp.path }}/paru-bin.tar.gz"
|
||||||
|
dest: "{{ paru_tmp.path }}"
|
||||||
|
remote_src: true
|
||||||
|
|
||||||
|
- name: Build the package (no install)
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: makepkg --syncdeps --noconfirm
|
||||||
|
chdir: "{{ paru_tmp.path }}/paru-bin"
|
||||||
|
environment:
|
||||||
|
PKGDEST: "{{ paru_tmp.path }}/paru-bin"
|
||||||
|
|
||||||
|
- name: Locate built package(s)
|
||||||
|
ansible.builtin.find:
|
||||||
|
paths: "{{ paru_tmp.path }}/paru-bin"
|
||||||
|
patterns: "*.pkg.tar.zst"
|
||||||
|
file_type: file
|
||||||
|
register: built_pkgs
|
||||||
|
|
||||||
|
# Install with root, but OUTSIDE makepkg
|
||||||
|
- name: Install built package(s)
|
||||||
|
become: true
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "pacman -U --noconfirm {{ item.path }}"
|
||||||
|
creates: /usr/bin/paru
|
||||||
|
loop: "{{ built_pkgs.files }}"
|
||||||
|
|
||||||
|
- name: Remove temporary directory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ paru_tmp.path }}"
|
||||||
|
state: absent
|
||||||
Reference in New Issue
Block a user