46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
|
version: "3"
|
|
|
|
vars:
|
|
ARCHFILE: "{{.ROOT_DIR}}/.taskfiles/Workstation/Archfile"
|
|
BREWFILE: "{{.ROOT_DIR}}/.taskfiles/Workstation/Brewfile"
|
|
|
|
tasks:
|
|
|
|
direnv:
|
|
desc: Run direnv hooks
|
|
cmd: direnv allow .
|
|
status:
|
|
- "[[ $(direnv status --json | jq '.state.foundRC.allowed') == 0 ]]"
|
|
- "[[ $(direnv status --json | jq '.state.loadedRC.allowed') == 0 ]]"
|
|
|
|
venv:
|
|
desc: Set up virtual environment
|
|
cmds:
|
|
- "{{.PYTHON_BIN}} -m venv {{.ROOT_DIR}}/.venv"
|
|
- .venv/bin/python3 -m pip install --upgrade pip setuptools wheel
|
|
- .venv/bin/python3 -m pip install --upgrade --requirement "{{.PIP_REQUIREMENTS_FILE}}"
|
|
sources:
|
|
- "{{.PIP_REQUIREMENTS_FILE}}"
|
|
generates:
|
|
- "{{.ROOT_DIR}}/.venv/pyvenv.cfg"
|
|
preconditions:
|
|
- { msg: "Missing Pip requirements file", sh: "test -f {{.PIP_REQUIREMENTS_FILE}}" }
|
|
|
|
brew:
|
|
desc: Install workstation dependencies with Brew
|
|
cmd: brew bundle --file {{.BREWFILE}}
|
|
preconditions:
|
|
- { msg: "Missing Homebrew", sh: "command -v brew" }
|
|
- { msg: "Missing Brewfile", sh: "test -f {{.BREWFILE}}" }
|
|
|
|
arch:
|
|
desc: Install Arch workstation dependencies with Paru Or Yay
|
|
cmd: "{{.helper}} -Syu --needed --noconfirm --noprogressbar $(cat {{.ARCHFILE}} | xargs)"
|
|
vars:
|
|
helper:
|
|
sh: "command -v yay || command -v paru"
|
|
preconditions:
|
|
- { msg: "Missing Archfile", sh: "test -f {{.ARCHFILE}}" }
|