Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ npm_packages:
pip_packages:
- name: mkdocs

# pipx support requires community.general >= 5.5.0. Set `pipx_ensurepath: true` to run
# `pipx ensurepath` and ensure pipx-installed apps are on PATH; use
# `backend: uv` only with pipx >= 1.12.0.
pipx_packages:
- cowsay
- name: ntfy
state: latest

configure_dock: true
dockitems_remove:
- Launchpad
Expand Down Expand Up @@ -127,6 +135,7 @@ Packages (installed with Homebrew):
- node
- nvm
- php
- pipx
- ssh-copy-id
- readline
- openssl
Expand Down
11 changes: 11 additions & 0 deletions default.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ homebrew_installed_packages:
- node
- nvm
- php
- pipx
- pngpaste
- ssh-copy-id
- readline
Expand Down Expand Up @@ -104,6 +105,16 @@ pip_packages: []
# state: present # present/absent/latest, default: present
# version: "0.16.3" # default: N/A

pipx_executable: pipx
pipx_default_backend: pip # Note: 'uv' backend requires pipx >= 1.12.0.
pipx_ensurepath: false
pipx_packages: []
# - cowsay
# - name: ntfy
# state: present # present/absent/latest, default: present
# executable: pipx # path/name of pipx binary, default: pipx_executable
# backend: pip # pip/uv (requires pipx >= 1.12.0), default: pipx_default_backend

# Set to 'true' to configure Sublime Text.
configure_sublime: false
sublime_base_path: "~/Library/Application Support/Sublime Text"
Expand Down
2 changes: 2 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ roles:

collections:
- name: geerlingguy.mac
- name: community.general
version: ">=5.5.0" # pipx module added in 3.8.0, but state: latest requires 5.5.0
20 changes: 20 additions & 0 deletions tasks/extra-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,23 @@
user_install: false
executable: "{{ item.executable | default(omit) }}"
loop: "{{ gem_packages }}"

- name: Ensure pipx application directory is on PATH.
ansible.builtin.command:
argv:
- "{{ pipx_executable }}"
- ensurepath
register: pipx_ensurepath_result
changed_when: "'Success' in pipx_ensurepath_result.stdout" # pipx outputs 'Success! ...' when PATH is modified; substring match covers the full message
when: pipx_ensurepath

- name: Install global Python applications via pipx.
community.general.pipx:
name: "{{ item.name | default(item) }}"
state: "{{ item.state | default('present') }}"
executable: "{{ item.executable | default(pipx_executable) }}"
loop: "{{ pipx_packages }}"
loop_control:
label: "{{ item.name | default(item) }}"
environment:
PIPX_DEFAULT_BACKEND: "{{ item.backend | default(pipx_default_backend) }}"
7 changes: 7 additions & 0 deletions tests/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ homebrew_installed_packages:
- sqlite
- ssh-copy-id
- readline
- pipx
- pv
- wget
- wrk

homebrew_cask_apps:
- firefox
- licecap

pipx_ensurepath: true

pipx_packages:
- name: pycowsay
- cowsay
Loading