From b42d25eb30be60a22c824abc45d6b4eff27c346e Mon Sep 17 00:00:00 2001 From: Bruno Semperlotti Date: Sat, 10 Jun 2023 00:43:47 +0200 Subject: [PATCH] feat!: massive refactoring and enhancement Drop linux support as it complexifies code and is never used. Replace deprecated antigen zsh package manager by antidote. Replace Ppwerlevel10k prompt by starship. Replace iTerm2 terminal app by alacritty. Replace docker by podman. Use zellij as terminal multiplexer. And more... Closes #51, #50, #23, #19, #18, #17, #15 --- .ansible-lint | 12 +- .github/workflows/test.yaml | 51 +- .yamllint | 9 - README.md | 14 +- host_vars/localhost.yml | 11 + playbooks/main.yml | 231 ++-- poetry.lock | 365 +++--- pyproject.toml | 7 +- roles/akamai/defaults/main.yml | 2 + roles/akamai/files/config/.edgerc.sample | 5 + roles/akamai/files/shell_config/akamai.zsh | 18 + roles/akamai/tasks/main.yml | 21 + roles/alacritty/defaults/main.yml | 2 + roles/alacritty/files/config/alacritty.yml | 905 ++++++++++++++ roles/alacritty/tasks/main.yml | 19 + roles/azure/defaults/main.yml | 2 - roles/azure/files/shell_config/azure.zsh | 1 + roles/azure/tasks/linux_install.yml | 3 - roles/azure/tasks/main.yml | 56 +- roles/cli_tools/defaults/main.yml | 60 +- .../{xdg_config_home => config}/curl/.curlrc | 0 .../files/config/screen}/.screenrc | 0 .../files/config/starship/starship.toml | 103 ++ .../cli_tools/files/config/zellij/config.kdl | 325 +++++ .../files/config/zellij/layouts/.gitkeep} | 0 .../files/config/zellij/themes/.gitkeep} | 0 roles/cli_tools/files/shell_config/exa.zsh | 19 + roles/cli_tools/files/shell_config/fzf.zsh | 22 + .../files/shell_config/gnu-tools.zsh | 16 + .../cli_tools/files/shell_config/starship.zsh | 8 + roles/cli_tools/files/shell_config/zellij.zsh | 10 + roles/cli_tools/files/shell_config/zoxide.zsh | 6 + roles/cli_tools/tasks/main.yml | 121 +- roles/docker/defaults/main.yml | 9 +- roles/docker/files/shell_config/podman.zsh | 9 + roles/docker/tasks/main.yml | 50 +- roles/fonts/defaults/main.yml | 4 +- roles/fonts/tasks/main.yml | 10 +- roles/git/defaults/main.yml | 7 +- .../git/files/{ => config/git}/dior_gitconfig | 0 .../files/{ => config/git}/gitignore_global | 3 + roles/git/files/{ => config/git}/gitmessage | 0 .../files/config}/tig/config | 0 roles/git/tasks/main.yml | 36 +- .../gitconfig => templates/gitconfig.j2} | 8 +- roles/gnu_tools/defaults/main.yml | 6 - roles/gnu_tools/tasks/main.yml | 31 - roles/gpg/defaults/main.yml | 7 +- .../.zprofile => gpg/files/config/.gitkeep} | 0 roles/gpg/files/shell_config/gpg.zsh | 7 + roles/gpg/tasks/main.yml | 143 +-- .../gpg-agent.conf.j2} | 5 +- roles/iterm2/defaults/main.yml | 12 +- roles/iterm2/tasks/main.yml | 9 +- roles/javascript/defaults/main.yml | 6 +- roles/javascript/files/shell_config/nvm.zsh | 5 + roles/javascript/tasks/linux_install.yml | 3 - roles/javascript/tasks/main.yml | 74 +- roles/kubernetes/defaults/main.yml | 15 + roles/kubernetes/defaults/main/linux.yml | 12 - roles/kubernetes/defaults/main/main.yml | 15 - roles/kubernetes/files/config/k9s/skin.yml | 109 ++ roles/kubernetes/files/config/kube/.gitkeep | 0 .../files/shell_config/kubernetes.zsh | 8 + roles/kubernetes/tasks/krew_install.yml | 24 +- roles/kubernetes/tasks/linux_install.yml | 103 -- roles/kubernetes/tasks/main.yml | 117 +- roles/nvim/defaults/main.yml | 3 + roles/nvim/files/config/init.vim | 0 roles/nvim/files/shell_config/nvim.zsh | 1 + roles/nvim/tasks/main.yml | 21 + roles/python/defaults/main.yml | 3 +- roles/python/tasks/main.yml | 15 +- roles/screen/defaults/main.yml | 4 - roles/screen/tasks/main.yml | 28 - roles/ssh/defaults/main.yml | 1 - roles/ssh/tasks/main.yml | 40 +- roles/terraform/defaults/main.yml | 6 +- .../files/shell_config/terraform.zsh | 9 + roles/terraform/tasks/linux_install.yml | 13 - roles/terraform/tasks/main.yml | 61 +- roles/vim/defaults/main.yml | 5 +- roles/vim/files/{ => config}/.vimrc | 0 roles/vim/tasks/main.yml | 27 +- roles/zsh/defaults/main.yml | 8 +- roles/zsh/files/.antigenrc | 61 - roles/zsh/files/.p10k.zsh | 1063 ----------------- roles/zsh/files/.zshrc | 68 -- roles/zsh/files/config/.zlogin | 0 roles/zsh/files/config/.zlogout | 0 roles/zsh/files/config/.zprofile | 0 roles/zsh/files/config/.zsh_plugins.txt | 33 + roles/zsh/files/config/.zshpluginsrc | 17 + roles/zsh/files/{ => config}/README.md | 5 +- .../files/{ => config}/completions/.gitkeep | 0 roles/zsh/files/config/config/history.zsh | 30 + .../{functions => config/config}/weather.zsh | 0 roles/zsh/files/custom/history.zsh | 22 - roles/zsh/files/custom/homebrew.zsh | 4 - roles/zsh/files/custom/system.zsh | 18 - roles/zsh/tasks/main.yml | 32 +- roles/zsh/templates/.zshenv.j2 | 19 + roles/zsh/templates/.zshenv.tpl | 4 - roles/zsh/templates/.zshrc.j2 | 62 + 104 files changed, 2464 insertions(+), 2490 deletions(-) delete mode 100644 .yamllint create mode 100644 host_vars/localhost.yml create mode 100644 roles/akamai/defaults/main.yml create mode 100755 roles/akamai/files/config/.edgerc.sample create mode 100644 roles/akamai/files/shell_config/akamai.zsh create mode 100644 roles/akamai/tasks/main.yml create mode 100644 roles/alacritty/defaults/main.yml create mode 100644 roles/alacritty/files/config/alacritty.yml create mode 100644 roles/alacritty/tasks/main.yml create mode 100644 roles/azure/files/shell_config/azure.zsh delete mode 100644 roles/azure/tasks/linux_install.yml rename roles/cli_tools/files/{xdg_config_home => config}/curl/.curlrc (100%) rename roles/{screen/files => cli_tools/files/config/screen}/.screenrc (100%) create mode 100644 roles/cli_tools/files/config/starship/starship.toml create mode 100644 roles/cli_tools/files/config/zellij/config.kdl rename roles/{zsh/files/.zlogin => cli_tools/files/config/zellij/layouts/.gitkeep} (100%) rename roles/{zsh/files/.zlogout => cli_tools/files/config/zellij/themes/.gitkeep} (100%) create mode 100644 roles/cli_tools/files/shell_config/exa.zsh create mode 100644 roles/cli_tools/files/shell_config/fzf.zsh create mode 100644 roles/cli_tools/files/shell_config/gnu-tools.zsh create mode 100644 roles/cli_tools/files/shell_config/starship.zsh create mode 100644 roles/cli_tools/files/shell_config/zellij.zsh create mode 100644 roles/cli_tools/files/shell_config/zoxide.zsh create mode 100644 roles/docker/files/shell_config/podman.zsh rename roles/git/files/{ => config/git}/dior_gitconfig (100%) rename roles/git/files/{ => config/git}/gitignore_global (72%) rename roles/git/files/{ => config/git}/gitmessage (100%) rename roles/{cli_tools/files/xdg_config_home => git/files/config}/tig/config (100%) rename roles/git/{files/gitconfig => templates/gitconfig.j2} (81%) delete mode 100644 roles/gnu_tools/defaults/main.yml delete mode 100644 roles/gnu_tools/tasks/main.yml rename roles/{zsh/files/.zprofile => gpg/files/config/.gitkeep} (100%) create mode 100644 roles/gpg/files/shell_config/gpg.zsh rename roles/gpg/{files/gpg-agent.conf => templates/gpg-agent.conf.j2} (59%) create mode 100644 roles/javascript/files/shell_config/nvm.zsh delete mode 100644 roles/javascript/tasks/linux_install.yml create mode 100644 roles/kubernetes/defaults/main.yml delete mode 100644 roles/kubernetes/defaults/main/linux.yml delete mode 100644 roles/kubernetes/defaults/main/main.yml create mode 100644 roles/kubernetes/files/config/k9s/skin.yml create mode 100644 roles/kubernetes/files/config/kube/.gitkeep create mode 100644 roles/kubernetes/files/shell_config/kubernetes.zsh delete mode 100644 roles/kubernetes/tasks/linux_install.yml create mode 100644 roles/nvim/defaults/main.yml create mode 100644 roles/nvim/files/config/init.vim create mode 100644 roles/nvim/files/shell_config/nvim.zsh create mode 100644 roles/nvim/tasks/main.yml delete mode 100644 roles/screen/defaults/main.yml delete mode 100644 roles/screen/tasks/main.yml create mode 100644 roles/terraform/files/shell_config/terraform.zsh delete mode 100644 roles/terraform/tasks/linux_install.yml rename roles/vim/files/{ => config}/.vimrc (100%) delete mode 100644 roles/zsh/files/.antigenrc delete mode 100644 roles/zsh/files/.p10k.zsh delete mode 100644 roles/zsh/files/.zshrc create mode 100644 roles/zsh/files/config/.zlogin create mode 100644 roles/zsh/files/config/.zlogout create mode 100644 roles/zsh/files/config/.zprofile create mode 100644 roles/zsh/files/config/.zsh_plugins.txt create mode 100644 roles/zsh/files/config/.zshpluginsrc rename roles/zsh/files/{ => config}/README.md (88%) rename roles/zsh/files/{ => config}/completions/.gitkeep (100%) create mode 100644 roles/zsh/files/config/config/history.zsh rename roles/zsh/files/{functions => config/config}/weather.zsh (100%) delete mode 100644 roles/zsh/files/custom/history.zsh delete mode 100644 roles/zsh/files/custom/homebrew.zsh delete mode 100644 roles/zsh/files/custom/system.zsh create mode 100644 roles/zsh/templates/.zshenv.j2 delete mode 100644 roles/zsh/templates/.zshenv.tpl create mode 100644 roles/zsh/templates/.zshrc.j2 diff --git a/.ansible-lint b/.ansible-lint index 8fdd031..6e82ce0 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,7 +1,13 @@ --- +profile: production + +exclude_paths: + - .github + - roles/**/files + warn_list: - - no-changed-when # Commands should not change things if nothing needs doing + - no-changed-when # Commands should not change things if nothing needs doing skip_list: - - unnamed-task # All tasks should be named - - package-latest # Package installs should not use latest + - unnamed-task # All tasks should be named + - package-latest # Package installs should not use latest diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index de7bd83..2a937e3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,12 +20,9 @@ env: PYTHON_VERSION: 3.11 jobs: - dependencies: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macOS-latest] + lint: + runs-on: ubuntu-latest + timeout-minutes: 15 steps: - name: Check out repository uses: actions/checkout@v3 @@ -53,42 +50,18 @@ jobs: if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root - lint: - needs: [dependencies] - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v3 - - - name: Set up python - uses: actions/setup-python@v4.5.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v3.3.1 - with: - path: .venv - key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - - name: Run lint run: poetry run ansible-lint - test: - needs: [dependencies] + deploy: + needs: lint runs-on: ${{ matrix.os }} + timeout-minutes: 120 + if: ${{ github.actor != 'dependabot[bot]' }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macOS-latest] + os: [macOS-latest] steps: - name: Check out repository uses: actions/checkout@v3 @@ -112,5 +85,11 @@ jobs: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + - name: Install playbook - run: poetry run ansible-playbook playbooks/main.yml -vv + run: | + export HOMEBREW_NO_AUTO_UPDATE=1 + poetry run ansible-playbook playbooks/main.yml -vv diff --git a/.yamllint b/.yamllint deleted file mode 100644 index 8dabc7d..0000000 --- a/.yamllint +++ /dev/null @@ -1,9 +0,0 @@ ---- -extends: default -yaml-files: - - ".ansible-lint" - - ".yamllint" - - "*.yaml" - - "*.yml" -rules: - line-length: disable diff --git a/README.md b/README.md index 12923e0..9ede444 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Example: playbook: playbooks/main.yml play #1 (all): Setup workstation TAGS: [] - TASK TAGS: [azure, cli-tools, docker, fonts, git, gnu-tools, gpg, homebrew-update, iterm2, javascript, kubernetes, python, screen, ssh, terraform, vim, zsh] + TASK TAGS: [akamai, alacritty, always, azure, cli-tools, docker, fonts, git, gpg, homebrew-update, iterm2, javascript, kubernetes, nvim, python, ssh, terraform, vim, zsh] #### Install selected components @@ -66,4 +66,14 @@ poetry run ansible-playbook playbooks/main.yml -t , Example: -`poetry run ansible-playbook playbooks/main.yml -t kubernetes,terraform` +```bash +poetry run ansible-playbook playbooks/main.yml -t kubernetes,terraform +``` + +## Development + +### Code lint + +```bash +poetry run ansible-lint +``` diff --git a/host_vars/localhost.yml b/host_vars/localhost.yml new file mode 100644 index 0000000..9e2fe0f --- /dev/null +++ b/host_vars/localhost.yml @@ -0,0 +1,11 @@ +home_directory: "{{ ansible_env.HOME }}" +# XDG environment variables (https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html) +xdg_data_home: "{{ home_directory }}/.local/share" +xdg_config_home: "{{ home_directory }}/.config" +xdg_state_home: "{{ home_directory }}/.local/state" +xdg_data_dirs: "/usr/local/share/:/usr/share/" +xdg_config_dirs: "/etc/xdg" +xdg_cache_home: "{{ home_directory }}/.cache" +xdg_runtime_dir: "" + +shell_config_dir: "{{ xdg_config_home }}/shell_config" diff --git a/playbooks/main.yml b/playbooks/main.yml index 1359746..fdb8806 100644 --- a/playbooks/main.yml +++ b/playbooks/main.yml @@ -1,123 +1,122 @@ --- - name: Setup workstation - hosts: all + hosts: localhost gather_facts: true - vars: - shell_config_dir: "{{ lookup('env','HOME') }}/.config/zsh" - tasks: - - name: Update homebrew - when: ansible_system == "Darwin" - community.general.homebrew: - update_homebrew: true - tags: - - homebrew-update - - - ansible.builtin.import_role: - name: fonts - tags: - - fonts - - - ansible.builtin.import_role: - name: python - tags: - - python - - - ansible.builtin.import_role: - name: zsh - vars: - zsh_config_dir: "{{ shell_config_dir }}" - tags: - - zsh - - - ansible.builtin.import_role: - name: git - tags: - - git - - - ansible.builtin.import_role: - name: gnu_tools - vars: - gnu_tools_shell_config_file: "{{ shell_config_dir }}/custom/gnu-tools.zsh" + - name: Init Homebrew when: ansible_system == "Darwin" - tags: - - gnu-tools - - - ansible.builtin.import_role: - name: cli_tools - vars: - cli_tools_shell_config_file: "{{ shell_config_dir }}/custom/cli-tools.zsh" - tags: - - cli-tools - - - ansible.builtin.import_role: - name: docker - vars: - docker_shell_config_file: "{{ shell_config_dir }}/custom/docker.zsh" - tags: - - docker - - - ansible.builtin.import_role: - name: vim - tags: - - vim - - - ansible.builtin.import_role: - name: screen - tags: - - screen - - - ansible.builtin.import_role: - name: ssh - tags: - - ssh - - - ansible.builtin.import_role: - name: gpg - vars: - gpg_shell_config_file: "{{ shell_config_dir }}/custom/gpg.zsh" - tags: - - gpg - - - ansible.builtin.import_role: - name: kubernetes - vars: - k8s_shell_config_file: "{{ shell_config_dir }}/custom/kubernetes.zsh" - tags: - - kubernetes - - - ansible.builtin.import_role: - name: terraform - vars: - terraform_shell_config_file: "{{ shell_config_dir }}/custom/terraform.zsh" - tags: - - terraform - - - ansible.builtin.import_role: - name: azure - vars: - azure_shell_config_file: "{{ shell_config_dir }}/custom/azure.zsh" - tags: - - azure - - - ansible.builtin.import_role: - name: javascript - vars: - javascript_shell_config_file: "{{ shell_config_dir }}/custom/javascript.zsh" - tags: - - javascript - - - ansible.builtin.import_role: - name: iterm2 - vars: - iterm2_defaults: - - name: OnlyWhenMoreTabs - type: string - value: true - - name: PromptOnQuit - type: bool - value: false + tags: always + block: + - name: Retrieve homebrew prefix + ansible.builtin.shell: | + brew --prefix + register: brew_prefix + changed_when: false + + - name: Register homebrew prefix as fact + ansible.builtin.set_fact: + homebrew_prefix: "{{ brew_prefix.stdout }}" + + - name: Disable homebrew analytics + ansible.builtin.shell: | + brew analytics off + changed_when: false + + - name: Update homebrew + community.general.homebrew: + update_homebrew: true + tags: + - homebrew-update + + - ansible.builtin.debug: + msg: | + Homebrew Prefix: {{ homebrew_prefix }} + + - name: Install MacOs tools when: ansible_system == "Darwin" - tags: - - iterm2 + block: + - ansible.builtin.import_role: + name: fonts + tags: + - fonts + + - ansible.builtin.import_role: + name: python + tags: + - python + + - ansible.builtin.import_role: + name: zsh + tags: + - zsh + + - ansible.builtin.import_role: + name: git + tags: + - git + + - ansible.builtin.import_role: + name: cli_tools + tags: + - cli-tools + + - ansible.builtin.import_role: + name: docker + tags: + - docker + + - ansible.builtin.import_role: + name: vim + tags: + - vim + + - ansible.builtin.import_role: + name: nvim + tags: + - nvim + + - ansible.builtin.import_role: + name: ssh + tags: + - ssh + + - ansible.builtin.import_role: + name: gpg + tags: + - gpg + + - ansible.builtin.import_role: + name: kubernetes + tags: + - kubernetes + + - ansible.builtin.import_role: + name: terraform + tags: + - terraform + + - ansible.builtin.import_role: + name: azure + tags: + - azure + + - ansible.builtin.import_role: + name: javascript + tags: + - javascript + + - ansible.builtin.import_role: + name: iterm2 + tags: + - iterm2 + + - ansible.builtin.import_role: + name: akamai + tags: + - akamai + + - ansible.builtin.import_role: + name: alacritty + tags: + - alacritty diff --git a/poetry.lock b/poetry.lock index 1341dca..9f035cd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,30 +1,50 @@ -# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. [[package]] name = "ansible" -version = "7.4.0" +version = "8.0.0" description = "Radically simple IT automation" -category = "main" optional = false python-versions = ">=3.9" files = [ - {file = "ansible-7.4.0-py3-none-any.whl", hash = "sha256:c9b5cae2ff8168b3dc859fff12275338cd7c84ef37f62889076f82846bb4beb5"}, - {file = "ansible-7.4.0.tar.gz", hash = "sha256:0964d6ec7b363d2d559f245c39b01798c720a85b207672ec2c9d83cf61564b90"}, + {file = "ansible-8.0.0-py3-none-any.whl", hash = "sha256:831bd24e4c312f71fe63efc3f993bea2fa04e257ddf5d1181192ea808d2fe77d"}, + {file = "ansible-8.0.0.tar.gz", hash = "sha256:8670c7c46021c188cac235e9fde7adadbb3c380c2436a3b0c1c493c4ba10bcab"}, ] [package.dependencies] -ansible-core = ">=2.14.4,<2.15.0" +ansible-core = ">=2.15.0,<2.16.0" + +[[package]] +name = "ansible-compat" +version = "4.1.2" +description = "Ansible compatibility goodies" +optional = false +python-versions = ">=3.9" +files = [ + {file = "ansible-compat-4.1.2.tar.gz", hash = "sha256:696162dbc1223c0b474136a61662b3fe44115d490de8da606b149cee572b01ed"}, + {file = "ansible_compat-4.1.2-py3-none-any.whl", hash = "sha256:67f84619b63239383e56eb6725f4617c10569da120b8e78e61ccf779c63afea5"}, +] + +[package.dependencies] +ansible-core = ">=2.12" +jsonschema = ">=4.6.0" +packaging = "*" +PyYAML = "*" +subprocess-tee = ">=0.4.1" + +[package.extras] +docs = ["argparse-manpage", "black", "mkdocs-ansible[lock] (>=0.1.2)"] +test = ["coverage", "pip-tools", "pytest (>=7.2.0)", "pytest-mock", "pytest-plus"] [[package]] name = "ansible-core" -version = "2.14.4" +version = "2.15.0" description = "Radically simple IT automation" -category = "main" optional = false python-versions = ">=3.9" files = [ - {file = "ansible-core-2.14.4.tar.gz", hash = "sha256:90b260bc264901d35fb1f0753f2b650813f54cfe6476540afbc6b25ef541ef14"}, - {file = "ansible_core-2.14.4-py3-none-any.whl", hash = "sha256:3915ef89f74ffd6277e534b4f14843d2425a3e7bb6ffae26eecd4cc571d020cc"}, + {file = "ansible-core-2.15.0.tar.gz", hash = "sha256:cf690fd4ebb40590e00c5acdc0624758ca4c58d1e4b2b02ec026a034070ebf4d"}, + {file = "ansible_core-2.15.0-py3-none-any.whl", hash = "sha256:723ef347b55ac48bb70951124d0b1e71d799cf7488924d484c3e88aaf9a8c14c"}, ] [package.dependencies] @@ -32,62 +52,61 @@ cryptography = "*" jinja2 = ">=3.0.0" packaging = "*" PyYAML = ">=5.1" -resolvelib = ">=0.5.3,<0.9.0" +resolvelib = ">=0.5.3,<1.1.0" [[package]] name = "ansible-lint" -version = "6.14.4" +version = "6.17.0" description = "Checks playbooks for practices and behavior that could potentially be improved" -category = "dev" optional = false python-versions = ">=3.9" files = [ - {file = "ansible-lint-6.14.4.tar.gz", hash = "sha256:4258a41e766cb16a88fea4c3d535f390f967c5af36e0e8cac2364c5ec99043db"}, - {file = "ansible_lint-6.14.4-py3-none-any.whl", hash = "sha256:890358e14102800425777f53fa086b6eefee58c2317353ebc8af2ec41c019f1d"}, + {file = "ansible-lint-6.17.0.tar.gz", hash = "sha256:c6da12e9eb6dd58223b0a48400aaa25e677af6cac3d9db41fb1b62006ddebb36"}, + {file = "ansible_lint-6.17.0-py3-none-any.whl", hash = "sha256:6464c00f977d2dbc0751b0adf5a265110e20654bc818a41f94fb0c4be2a90d8a"}, ] [package.dependencies] +ansible-compat = ">=4.0.5" ansible-core = ">=2.12.0" black = ">=22.8.0" filelock = ">=3.3.0" jsonschema = ">=4.10.0" packaging = ">=21.3" +pathspec = ">=0.9.0" pyyaml = ">=5.4.1" rich = ">=12.0.0" -"ruamel.yaml" = ">=0.17.21,<0.18" +"ruamel.yaml" = ">=0.17.0,<0.17.29 || >0.17.29,<0.17.30 || >0.17.30,<0.18" subprocess-tee = ">=0.4.1" wcmatch = ">=8.1.2" yamllint = ">=1.30.0" [package.extras] -docs = ["mkdocs-ansible[lock] (>=0.1.2)", "pipdeptree (>=2.4.0)"] -lock = ["ansible-core (==2.14.4)", "attrs (==22.2.0)", "black (==23.3.0)", "bracex (==2.3.post1)", "cffi (==1.15.1)", "click (==8.1.3)", "cryptography (==40.0.1)", "filelock (==3.10.7)", "jinja2 (==3.1.2)", "jsonschema (==4.17.3)", "markdown-it-py (==2.2.0)", "markupsafe (==2.1.2)", "mdurl (==0.1.2)", "mypy-extensions (==1.0.0)", "packaging (==23.0)", "pathspec (==0.11.1)", "platformdirs (==3.2.0)", "pycparser (==2.21)", "pygments (==2.14.0)", "pyrsistent (==0.19.3)", "pyyaml (==6.0)", "resolvelib (==0.8.1)", "rich (==13.3.3)", "ruamel-yaml (==0.17.21)", "setuptools (==67.6.1)", "subprocess-tee (==0.4.1)", "tomli (==2.0.1)", "typing-extensions (==4.5.0)", "wcmatch (==8.4.1)", "yamllint (==1.30.0)"] -test = ["black", "coverage-enable-subprocess", "coverage[toml] (>=6.4.4)", "flake8", "flake8-future-annotations", "mypy", "psutil", "pylint", "pytest (>=7.2.2)", "pytest-mock", "pytest-plus (>=0.2)", "pytest-xdist (>=2.1.0)", "spdx-tools (>=0.7.1)", "types-jsonschema", "types-pyyaml"] +docs = ["mkdocs-ansible[lock] (>=0.1.4)", "pipdeptree (>=2.4.0)"] +lock = ["ansible-compat (==4.1.0)", "ansible-core (==2.15.0)", "attrs (==23.1.0)", "black (==23.3.0)", "bracex (==2.3.post1)", "cffi (==1.15.1)", "click (==8.1.3)", "cryptography (==40.0.2)", "filelock (==3.12.0)", "importlib-resources (==5.0.7)", "jinja2 (==3.1.2)", "jsonschema (==4.17.3)", "markdown-it-py (==2.2.0)", "markupsafe (==2.1.2)", "mdurl (==0.1.2)", "mypy-extensions (==1.0.0)", "packaging (==23.1)", "pathspec (==0.11.1)", "platformdirs (==3.5.1)", "pycparser (==2.21)", "pygments (==2.15.1)", "pyrsistent (==0.19.3)", "pyyaml (==6.0)", "rich (==13.3.5)", "ruamel-yaml (==0.17.31)", "subprocess-tee (==0.4.1)", "tomli (==2.0.1)", "typing-extensions (==4.6.2)", "wcmatch (==8.4.1)", "yamllint (==1.32.0)"] +test = ["black", "coverage-enable-subprocess", "coverage[toml] (>=6.4.4)", "jmespath", "mypy", "netaddr", "psutil", "pylint", "pytest (>=7.2.2)", "pytest-mock", "pytest-plus (>=0.2)", "pytest-xdist (>=2.1.0)", "ruamel-yaml-clib", "ruamel.yaml (>=0.17.31,<0.18)", "spdx-tools (>=0.7.1)", "types-jsonschema", "types-pyyaml"] [[package]] name = "attrs" -version = "22.2.0" +version = "23.1.0" description = "Classes Without Boilerplate" -category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "attrs-22.2.0-py3-none-any.whl", hash = "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836"}, - {file = "attrs-22.2.0.tar.gz", hash = "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"}, + {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, + {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, ] [package.extras] -cov = ["attrs[tests]", "coverage-enable-subprocess", "coverage[toml] (>=5.3)"] -dev = ["attrs[docs,tests]"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope.interface"] -tests = ["attrs[tests-no-zope]", "zope.interface"] -tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy (>=0.971,<0.990)", "mypy (>=0.971,<0.990)", "pympler", "pympler", "pytest (>=4.3.0)", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-mypy-plugins", "pytest-xdist[psutil]", "pytest-xdist[psutil]"] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[docs,tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] [[package]] name = "black" version = "23.3.0" description = "The uncompromising code formatter." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -135,7 +154,6 @@ uvloop = ["uvloop (>=0.15.2)"] name = "bracex" version = "2.3.post1" description = "Bash style brace expander." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -147,7 +165,6 @@ files = [ name = "cffi" version = "1.15.1" description = "Foreign Function Interface for Python calling C code." -category = "main" optional = false python-versions = "*" files = [ @@ -224,7 +241,6 @@ pycparser = "*" name = "click" version = "8.1.3" description = "Composable command line interface toolkit" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -234,31 +250,30 @@ files = [ [[package]] name = "cryptography" -version = "40.0.1" +version = "41.0.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "cryptography-40.0.1-cp36-abi3-macosx_10_12_universal2.whl", hash = "sha256:918cb89086c7d98b1b86b9fdb70c712e5a9325ba6f7d7cfb509e784e0cfc6917"}, - {file = "cryptography-40.0.1-cp36-abi3-macosx_10_12_x86_64.whl", hash = "sha256:9618a87212cb5200500e304e43691111570e1f10ec3f35569fdfcd17e28fd797"}, - {file = "cryptography-40.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a4805a4ca729d65570a1b7cac84eac1e431085d40387b7d3bbaa47e39890b88"}, - {file = "cryptography-40.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63dac2d25c47f12a7b8aa60e528bfb3c51c5a6c5a9f7c86987909c6c79765554"}, - {file = "cryptography-40.0.1-cp36-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:0a4e3406cfed6b1f6d6e87ed243363652b2586b2d917b0609ca4f97072994405"}, - {file = "cryptography-40.0.1-cp36-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:1e0af458515d5e4028aad75f3bb3fe7a31e46ad920648cd59b64d3da842e4356"}, - {file = "cryptography-40.0.1-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:d8aa3609d337ad85e4eb9bb0f8bcf6e4409bfb86e706efa9a027912169e89122"}, - {file = "cryptography-40.0.1-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:cf91e428c51ef692b82ce786583e214f58392399cf65c341bc7301d096fa3ba2"}, - {file = "cryptography-40.0.1-cp36-abi3-win32.whl", hash = "sha256:650883cc064297ef3676b1db1b7b1df6081794c4ada96fa457253c4cc40f97db"}, - {file = "cryptography-40.0.1-cp36-abi3-win_amd64.whl", hash = "sha256:a805a7bce4a77d51696410005b3e85ae2839bad9aa38894afc0aa99d8e0c3160"}, - {file = "cryptography-40.0.1-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:cd033d74067d8928ef00a6b1327c8ea0452523967ca4463666eeba65ca350d4c"}, - {file = "cryptography-40.0.1-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d36bbeb99704aabefdca5aee4eba04455d7a27ceabd16f3b3ba9bdcc31da86c4"}, - {file = "cryptography-40.0.1-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:32057d3d0ab7d4453778367ca43e99ddb711770477c4f072a51b3ca69602780a"}, - {file = "cryptography-40.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:f5d7b79fa56bc29580faafc2ff736ce05ba31feaa9d4735048b0de7d9ceb2b94"}, - {file = "cryptography-40.0.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7c872413353c70e0263a9368c4993710070e70ab3e5318d85510cc91cce77e7c"}, - {file = "cryptography-40.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:28d63d75bf7ae4045b10de5413fb1d6338616e79015999ad9cf6fc538f772d41"}, - {file = "cryptography-40.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:6f2bbd72f717ce33100e6467572abaedc61f1acb87b8d546001328d7f466b778"}, - {file = "cryptography-40.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:cc3a621076d824d75ab1e1e530e66e7e8564e357dd723f2533225d40fe35c60c"}, - {file = "cryptography-40.0.1.tar.gz", hash = "sha256:2803f2f8b1e95f614419926c7e6f55d828afc614ca5ed61543877ae668cc3472"}, + {file = "cryptography-41.0.1-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:f73bff05db2a3e5974a6fd248af2566134d8981fd7ab012e5dd4ddb1d9a70699"}, + {file = "cryptography-41.0.1-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:1a5472d40c8f8e91ff7a3d8ac6dfa363d8e3138b961529c996f3e2df0c7a411a"}, + {file = "cryptography-41.0.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7fa01527046ca5facdf973eef2535a27fec4cb651e4daec4d043ef63f6ecd4ca"}, + {file = "cryptography-41.0.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b46e37db3cc267b4dea1f56da7346c9727e1209aa98487179ee8ebed09d21e43"}, + {file = "cryptography-41.0.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:d198820aba55660b4d74f7b5fd1f17db3aa5eb3e6893b0a41b75e84e4f9e0e4b"}, + {file = "cryptography-41.0.1-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:948224d76c4b6457349d47c0c98657557f429b4e93057cf5a2f71d603e2fc3a3"}, + {file = "cryptography-41.0.1-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:059e348f9a3c1950937e1b5d7ba1f8e968508ab181e75fc32b879452f08356db"}, + {file = "cryptography-41.0.1-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:b4ceb5324b998ce2003bc17d519080b4ec8d5b7b70794cbd2836101406a9be31"}, + {file = "cryptography-41.0.1-cp37-abi3-win32.whl", hash = "sha256:8f4ab7021127a9b4323537300a2acfb450124b2def3756f64dc3a3d2160ee4b5"}, + {file = "cryptography-41.0.1-cp37-abi3-win_amd64.whl", hash = "sha256:1fee5aacc7367487b4e22484d3c7e547992ed726d14864ee33c0176ae43b0d7c"}, + {file = "cryptography-41.0.1-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:9a6c7a3c87d595608a39980ebaa04d5a37f94024c9f24eb7d10262b92f739ddb"}, + {file = "cryptography-41.0.1-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5d092fdfedaec4cbbffbf98cddc915ba145313a6fdaab83c6e67f4e6c218e6f3"}, + {file = "cryptography-41.0.1-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:1a8e6c2de6fbbcc5e14fd27fb24414507cb3333198ea9ab1258d916f00bc3039"}, + {file = "cryptography-41.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:cb33ccf15e89f7ed89b235cff9d49e2e62c6c981a6061c9c8bb47ed7951190bc"}, + {file = "cryptography-41.0.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5f0ff6e18d13a3de56f609dd1fd11470918f770c6bd5d00d632076c727d35485"}, + {file = "cryptography-41.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:7bfc55a5eae8b86a287747053140ba221afc65eb06207bedf6e019b8934b477c"}, + {file = "cryptography-41.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:eb8163f5e549a22888c18b0d53d6bb62a20510060a22fd5a995ec8a05268df8a"}, + {file = "cryptography-41.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:8dde71c4169ec5ccc1087bb7521d54251c016f126f922ab2dfe6649170a3b8c5"}, + {file = "cryptography-41.0.1.tar.gz", hash = "sha256:d34579085401d3f49762d2f7d6634d6b6c2ae1242202e860f4d26b046e3a1006"}, ] [package.dependencies] @@ -267,34 +282,32 @@ cffi = ">=1.12" [package.extras] docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] docstest = ["pyenchant (>=1.6.11)", "sphinxcontrib-spelling (>=4.0.1)", "twine (>=1.12.0)"] -pep8test = ["black", "check-manifest", "mypy", "ruff"] -sdist = ["setuptools-rust (>=0.11.4)"] +nox = ["nox"] +pep8test = ["black", "check-sdist", "mypy", "ruff"] +sdist = ["build"] ssh = ["bcrypt (>=3.1.5)"] -test = ["iso8601", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-shard (>=0.1.2)", "pytest-subtests", "pytest-xdist"] +test = ["pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] -tox = ["tox"] [[package]] name = "filelock" -version = "3.11.0" +version = "3.12.0" description = "A platform independent file lock." -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "filelock-3.11.0-py3-none-any.whl", hash = "sha256:f08a52314748335c6460fc8fe40cd5638b85001225db78c2aa01c8c0db83b318"}, - {file = "filelock-3.11.0.tar.gz", hash = "sha256:3618c0da67adcc0506b015fd11ef7faf1b493f0b40d87728e19986b536890c37"}, + {file = "filelock-3.12.0-py3-none-any.whl", hash = "sha256:ad98852315c2ab702aeb628412cbf7e95b7ce8c3bf9565670b4eaecf1db370a9"}, + {file = "filelock-3.12.0.tar.gz", hash = "sha256:fc03ae43288c013d2ea83c8597001b1129db351aad9c57fe2409327916b8e718"}, ] [package.extras] -docs = ["furo (>=2023.3.27)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.2.2)", "diff-cover (>=7.5)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] +docs = ["furo (>=2023.3.27)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.2.3)", "diff-cover (>=7.5)", "pytest (>=7.3.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] [[package]] name = "jinja2" version = "3.1.2" description = "A very fast and expressive template engine." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -312,7 +325,6 @@ i18n = ["Babel (>=2.7)"] name = "jsonschema" version = "4.17.3" description = "An implementation of JSON Schema validation for Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -332,7 +344,6 @@ format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339- name = "markdown-it-py" version = "2.2.0" description = "Python port of markdown-it. Markdown parsing, done right!" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -355,69 +366,67 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] [[package]] name = "markupsafe" -version = "2.1.2" +version = "2.1.3" description = "Safely add untrusted strings to HTML/XML markup." -category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "MarkupSafe-2.1.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:665a36ae6f8f20a4676b53224e33d456a6f5a72657d9c83c2aa00765072f31f7"}, - {file = "MarkupSafe-2.1.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:340bea174e9761308703ae988e982005aedf427de816d1afe98147668cc03036"}, - {file = "MarkupSafe-2.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22152d00bf4a9c7c83960521fc558f55a1adbc0631fbb00a9471e097b19d72e1"}, - {file = "MarkupSafe-2.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28057e985dace2f478e042eaa15606c7efccb700797660629da387eb289b9323"}, - {file = "MarkupSafe-2.1.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca244fa73f50a800cf8c3ebf7fd93149ec37f5cb9596aa8873ae2c1d23498601"}, - {file = "MarkupSafe-2.1.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d9d971ec1e79906046aa3ca266de79eac42f1dbf3612a05dc9368125952bd1a1"}, - {file = "MarkupSafe-2.1.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7e007132af78ea9df29495dbf7b5824cb71648d7133cf7848a2a5dd00d36f9ff"}, - {file = "MarkupSafe-2.1.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7313ce6a199651c4ed9d7e4cfb4aa56fe923b1adf9af3b420ee14e6d9a73df65"}, - {file = "MarkupSafe-2.1.2-cp310-cp310-win32.whl", hash = "sha256:c4a549890a45f57f1ebf99c067a4ad0cb423a05544accaf2b065246827ed9603"}, - {file = "MarkupSafe-2.1.2-cp310-cp310-win_amd64.whl", hash = "sha256:835fb5e38fd89328e9c81067fd642b3593c33e1e17e2fdbf77f5676abb14a156"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:2ec4f2d48ae59bbb9d1f9d7efb9236ab81429a764dedca114f5fdabbc3788013"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:608e7073dfa9e38a85d38474c082d4281f4ce276ac0010224eaba11e929dd53a"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:65608c35bfb8a76763f37036547f7adfd09270fbdbf96608be2bead319728fcd"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2bfb563d0211ce16b63c7cb9395d2c682a23187f54c3d79bfec33e6705473c6"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:da25303d91526aac3672ee6d49a2f3db2d9502a4a60b55519feb1a4c7714e07d"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:9cad97ab29dfc3f0249b483412c85c8ef4766d96cdf9dcf5a1e3caa3f3661cf1"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:085fd3201e7b12809f9e6e9bc1e5c96a368c8523fad5afb02afe3c051ae4afcc"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1bea30e9bf331f3fef67e0a3877b2288593c98a21ccb2cf29b74c581a4eb3af0"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-win32.whl", hash = "sha256:7df70907e00c970c60b9ef2938d894a9381f38e6b9db73c5be35e59d92e06625"}, - {file = "MarkupSafe-2.1.2-cp311-cp311-win_amd64.whl", hash = "sha256:e55e40ff0cc8cc5c07996915ad367fa47da6b3fc091fdadca7f5403239c5fec3"}, - {file = "MarkupSafe-2.1.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a6e40afa7f45939ca356f348c8e23048e02cb109ced1eb8420961b2f40fb373a"}, - {file = "MarkupSafe-2.1.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf877ab4ed6e302ec1d04952ca358b381a882fbd9d1b07cccbfd61783561f98a"}, - {file = "MarkupSafe-2.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63ba06c9941e46fa389d389644e2d8225e0e3e5ebcc4ff1ea8506dce646f8c8a"}, - {file = "MarkupSafe-2.1.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f1cd098434e83e656abf198f103a8207a8187c0fc110306691a2e94a78d0abb2"}, - {file = "MarkupSafe-2.1.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:55f44b440d491028addb3b88f72207d71eeebfb7b5dbf0643f7c023ae1fba619"}, - {file = "MarkupSafe-2.1.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:a6f2fcca746e8d5910e18782f976489939d54a91f9411c32051b4aab2bd7c513"}, - {file = "MarkupSafe-2.1.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0b462104ba25f1ac006fdab8b6a01ebbfbce9ed37fd37fd4acd70c67c973e460"}, - {file = "MarkupSafe-2.1.2-cp37-cp37m-win32.whl", hash = "sha256:7668b52e102d0ed87cb082380a7e2e1e78737ddecdde129acadb0eccc5423859"}, - {file = "MarkupSafe-2.1.2-cp37-cp37m-win_amd64.whl", hash = "sha256:6d6607f98fcf17e534162f0709aaad3ab7a96032723d8ac8750ffe17ae5a0666"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:a806db027852538d2ad7555b203300173dd1b77ba116de92da9afbc3a3be3eed"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a4abaec6ca3ad8660690236d11bfe28dfd707778e2442b45addd2f086d6ef094"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f03a532d7dee1bed20bc4884194a16160a2de9ffc6354b3878ec9682bb623c54"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4cf06cdc1dda95223e9d2d3c58d3b178aa5dacb35ee7e3bbac10e4e1faacb419"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:22731d79ed2eb25059ae3df1dfc9cb1546691cc41f4e3130fe6bfbc3ecbbecfa"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f8ffb705ffcf5ddd0e80b65ddf7bed7ee4f5a441ea7d3419e861a12eaf41af58"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8db032bf0ce9022a8e41a22598eefc802314e81b879ae093f36ce9ddf39ab1ba"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2298c859cfc5463f1b64bd55cb3e602528db6fa0f3cfd568d3605c50678f8f03"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-win32.whl", hash = "sha256:50c42830a633fa0cf9e7d27664637532791bfc31c731a87b202d2d8ac40c3ea2"}, - {file = "MarkupSafe-2.1.2-cp38-cp38-win_amd64.whl", hash = "sha256:bb06feb762bade6bf3c8b844462274db0c76acc95c52abe8dbed28ae3d44a147"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:99625a92da8229df6d44335e6fcc558a5037dd0a760e11d84be2260e6f37002f"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8bca7e26c1dd751236cfb0c6c72d4ad61d986e9a41bbf76cb445f69488b2a2bd"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40627dcf047dadb22cd25ea7ecfe9cbf3bbbad0482ee5920b582f3809c97654f"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40dfd3fefbef579ee058f139733ac336312663c6706d1163b82b3003fb1925c4"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:090376d812fb6ac5f171e5938e82e7f2d7adc2b629101cec0db8b267815c85e2"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:2e7821bffe00aa6bd07a23913b7f4e01328c3d5cc0b40b36c0bd81d362faeb65"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:c0a33bc9f02c2b17c3ea382f91b4db0e6cde90b63b296422a939886a7a80de1c"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:b8526c6d437855442cdd3d87eede9c425c4445ea011ca38d937db299382e6fa3"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-win32.whl", hash = "sha256:137678c63c977754abe9086a3ec011e8fd985ab90631145dfb9294ad09c102a7"}, - {file = "MarkupSafe-2.1.2-cp39-cp39-win_amd64.whl", hash = "sha256:0576fe974b40a400449768941d5d0858cc624e3249dfd1e0c33674e5c7ca7aed"}, - {file = "MarkupSafe-2.1.2.tar.gz", hash = "sha256:abcabc8c2b26036d62d4c746381a6f7cf60aafcc653198ad678306986b09450d"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-win32.whl", hash = "sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl", hash = "sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-win32.whl", hash = "sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-win_amd64.whl", hash = "sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-win32.whl", hash = "sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-win_amd64.whl", hash = "sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-win32.whl", hash = "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba"}, + {file = "MarkupSafe-2.1.3.tar.gz", hash = "sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"}, ] [[package]] name = "mdurl" version = "0.1.2" description = "Markdown URL utilities" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -429,7 +438,6 @@ files = [ name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -441,7 +449,6 @@ files = [ name = "packaging" version = "23.1" description = "Core utilities for Python packages" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -453,7 +460,6 @@ files = [ name = "pathspec" version = "0.11.1" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -463,25 +469,23 @@ files = [ [[package]] name = "platformdirs" -version = "3.2.0" +version = "3.5.1" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.2.0-py3-none-any.whl", hash = "sha256:ebe11c0d7a805086e99506aa331612429a72ca7cd52a1f0d277dc4adc20cb10e"}, - {file = "platformdirs-3.2.0.tar.gz", hash = "sha256:d5b638ca397f25f979350ff789db335903d7ea010ab28903f57b27e1b16c2b08"}, + {file = "platformdirs-3.5.1-py3-none-any.whl", hash = "sha256:e2378146f1964972c03c085bb5662ae80b2b8c06226c54b2ff4aa9483e8a13a5"}, + {file = "platformdirs-3.5.1.tar.gz", hash = "sha256:412dae91f52a6f84830f39a8078cecd0e866cb72294a5c66808e74d5e88d251f"}, ] [package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +docs = ["furo (>=2023.3.27)", "proselint (>=0.13)", "sphinx (>=6.2.1)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.3.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] [[package]] name = "pycparser" version = "2.21" description = "C parser in Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -491,14 +495,13 @@ files = [ [[package]] name = "pygments" -version = "2.15.0" +version = "2.15.1" description = "Pygments is a syntax highlighting package written in Python." -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "Pygments-2.15.0-py3-none-any.whl", hash = "sha256:77a3299119af881904cd5ecd1ac6a66214b6e9bed1f2db16993b54adede64094"}, - {file = "Pygments-2.15.0.tar.gz", hash = "sha256:f7e36cffc4c517fbc252861b9a6e4644ca0e5abadf9a113c72d1358ad09b9500"}, + {file = "Pygments-2.15.1-py3-none-any.whl", hash = "sha256:db2db3deb4b4179f399a09054b023b6a586b76499d36965813c71aa8ed7b5fd1"}, + {file = "Pygments-2.15.1.tar.gz", hash = "sha256:8ace4d3c1dd481894b2005f560ead0f9f19ee64fe983366be1a21e171d12775c"}, ] [package.extras] @@ -508,7 +511,6 @@ plugins = ["importlib-metadata"] name = "pyrsistent" version = "0.19.3" description = "Persistent/Functional/Immutable data structures" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -545,7 +547,6 @@ files = [ name = "pyyaml" version = "6.0" description = "YAML parser and emitter for Python" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -593,14 +594,13 @@ files = [ [[package]] name = "resolvelib" -version = "0.8.1" +version = "1.0.1" description = "Resolve abstract dependencies into concrete ones" -category = "main" optional = false python-versions = "*" files = [ - {file = "resolvelib-0.8.1-py2.py3-none-any.whl", hash = "sha256:d9b7907f055c3b3a2cfc56c914ffd940122915826ff5fb5b1de0c99778f4de98"}, - {file = "resolvelib-0.8.1.tar.gz", hash = "sha256:c6ea56732e9fb6fca1b2acc2ccc68a0b6b8c566d8f3e78e0443310ede61dbd37"}, + {file = "resolvelib-1.0.1-py2.py3-none-any.whl", hash = "sha256:d2da45d1a8dfee81bdd591647783e340ef3bcb104b54c383f70d422ef5cc7dbf"}, + {file = "resolvelib-1.0.1.tar.gz", hash = "sha256:04ce76cbd63fded2078ce224785da6ecd42b9564b1390793f64ddecbe997b309"}, ] [package.extras] @@ -611,14 +611,13 @@ test = ["commentjson", "packaging", "pytest"] [[package]] name = "rich" -version = "13.3.4" +version = "13.4.1" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" -category = "dev" optional = false python-versions = ">=3.7.0" files = [ - {file = "rich-13.3.4-py3-none-any.whl", hash = "sha256:22b74cae0278fd5086ff44144d3813be1cedc9115bdfabbfefd86400cb88b20a"}, - {file = "rich-13.3.4.tar.gz", hash = "sha256:b5d573e13605423ec80bdd0cd5f8541f7844a0e71a13f74cf454ccb2f490708b"}, + {file = "rich-13.4.1-py3-none-any.whl", hash = "sha256:d204aadb50b936bf6b1a695385429d192bc1fdaf3e8b907e8e26f4c4e4b5bf75"}, + {file = "rich-13.4.1.tar.gz", hash = "sha256:76f6b65ea7e5c5d924ba80e322231d7cb5b5981aa60bfc1e694f1bc097fe6fe1"}, ] [package.dependencies] @@ -630,42 +629,71 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "ruamel-yaml" -version = "0.17.21" +version = "0.17.31" description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" -category = "dev" optional = false python-versions = ">=3" files = [ - {file = "ruamel.yaml-0.17.21-py3-none-any.whl", hash = "sha256:742b35d3d665023981bd6d16b3d24248ce5df75fdb4e2924e93a05c1f8b61ca7"}, - {file = "ruamel.yaml-0.17.21.tar.gz", hash = "sha256:8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af"}, + {file = "ruamel.yaml-0.17.31-py3-none-any.whl", hash = "sha256:3cf153f0047ced526e723097ac615d3009371779432e304dbd5596b6f3a4c777"}, + {file = "ruamel.yaml-0.17.31.tar.gz", hash = "sha256:098ed1eb6d338a684891a72380277c1e6fc4d4ae0e120de9a447275056dda335"}, ] +[package.dependencies] +"ruamel.yaml.clib" = {version = ">=0.2.7", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.12\""} + [package.extras] docs = ["ryd"] jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] [[package]] -name = "setuptools" -version = "67.6.1" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "dev" +name = "ruamel-yaml-clib" +version = "0.2.7" +description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" optional = false -python-versions = ">=3.7" +python-versions = ">=3.5" files = [ - {file = "setuptools-67.6.1-py3-none-any.whl", hash = "sha256:e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078"}, - {file = "setuptools-67.6.1.tar.gz", hash = "sha256:257de92a9d50a60b8e22abfcbb771571fde0dbf3ec234463212027a4eeecbe9a"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d5859983f26d8cd7bb5c287ef452e8aacc86501487634573d260968f753e1d71"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:debc87a9516b237d0466a711b18b6ebeb17ba9f391eb7f91c649c5c4ec5006c7"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:df5828871e6648db72d1c19b4bd24819b80a755c4541d3409f0f7acd0f335c80"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:efa08d63ef03d079dcae1dfe334f6c8847ba8b645d08df286358b1f5293d24ab"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-win32.whl", hash = "sha256:763d65baa3b952479c4e972669f679fe490eee058d5aa85da483ebae2009d231"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-win_amd64.whl", hash = "sha256:d000f258cf42fec2b1bbf2863c61d7b8918d31ffee905da62dede869254d3b8a"}, + {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:045e0626baf1c52e5527bd5db361bc83180faaba2ff586e763d3d5982a876a9e"}, + {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-macosx_12_6_arm64.whl", hash = "sha256:721bc4ba4525f53f6a611ec0967bdcee61b31df5a56801281027a3a6d1c2daf5"}, + {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:41d0f1fa4c6830176eef5b276af04c89320ea616655d01327d5ce65e50575c94"}, + {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-win32.whl", hash = "sha256:f6d3d39611ac2e4f62c3128a9eed45f19a6608670c5a2f4f07f24e8de3441d38"}, + {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-win_amd64.whl", hash = "sha256:da538167284de58a52109a9b89b8f6a53ff8437dd6dc26d33b57bf6699153122"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:4b3a93bb9bc662fc1f99c5c3ea8e623d8b23ad22f861eb6fce9377ac07ad6072"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-macosx_12_0_arm64.whl", hash = "sha256:a234a20ae07e8469da311e182e70ef6b199d0fbeb6c6cc2901204dd87fb867e8"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:15910ef4f3e537eea7fe45f8a5d19997479940d9196f357152a09031c5be59f3"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:370445fd795706fd291ab00c9df38a0caed0f17a6fb46b0f607668ecb16ce763"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-win32.whl", hash = "sha256:ecdf1a604009bd35c674b9225a8fa609e0282d9b896c03dd441a91e5f53b534e"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-win_amd64.whl", hash = "sha256:f34019dced51047d6f70cb9383b2ae2853b7fc4dce65129a5acd49f4f9256646"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2aa261c29a5545adfef9296b7e33941f46aa5bbd21164228e833412af4c9c75f"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-macosx_12_0_arm64.whl", hash = "sha256:f01da5790e95815eb5a8a138508c01c758e5f5bc0ce4286c4f7028b8dd7ac3d0"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:40d030e2329ce5286d6b231b8726959ebbe0404c92f0a578c0e2482182e38282"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:c3ca1fbba4ae962521e5eb66d72998b51f0f4d0f608d3c0347a48e1af262efa7"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-win32.whl", hash = "sha256:7bdb4c06b063f6fd55e472e201317a3bb6cdeeee5d5a38512ea5c01e1acbdd93"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-win_amd64.whl", hash = "sha256:be2a7ad8fd8f7442b24323d24ba0b56c51219513cfa45b9ada3b87b76c374d4b"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:91a789b4aa0097b78c93e3dc4b40040ba55bef518f84a40d4442f713b4094acb"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:99e77daab5d13a48a4054803d052ff40780278240a902b880dd37a51ba01a307"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:3243f48ecd450eddadc2d11b5feb08aca941b5cd98c9b1db14b2fd128be8c697"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:8831a2cedcd0f0927f788c5bdf6567d9dc9cc235646a434986a852af1cb54b4b"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-win32.whl", hash = "sha256:3110a99e0f94a4a3470ff67fc20d3f96c25b13d24c6980ff841e82bafe827cac"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-win_amd64.whl", hash = "sha256:92460ce908546ab69770b2e576e4f99fbb4ce6ab4b245345a3869a0a0410488f"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5bc0667c1eb8f83a3752b71b9c4ba55ef7c7058ae57022dd9b29065186a113d9"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:4a4d8d417868d68b979076a9be6a38c676eca060785abaa6709c7b31593c35d1"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:bf9a6bc4a0221538b1a7de3ed7bca4c93c02346853f44e1cd764be0023cd3640"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a7b301ff08055d73223058b5c46c55638917f04d21577c95e00e0c4d79201a6b"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-win32.whl", hash = "sha256:d5e51e2901ec2366b79f16c2299a03e74ba4531ddcfacc1416639c557aef0ad8"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-win_amd64.whl", hash = "sha256:184faeaec61dbaa3cace407cffc5819f7b977e75360e8d5ca19461cd851a5fc5"}, + {file = "ruamel.yaml.clib-0.2.7.tar.gz", hash = "sha256:1f08fd5a2bea9c4180db71678e850b995d2a5f4537be0e94557668cf0f5f9497"}, ] -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - [[package]] name = "subprocess-tee" version = "0.4.1" description = "subprocess-tee" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -680,7 +708,6 @@ test = ["enrich (>=1.2.6)", "molecule (>=3.4.0)", "pytest (>=6.2.5)", "pytest-co name = "wcmatch" version = "8.4.1" description = "Wildcard/glob file name matcher." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -693,21 +720,23 @@ bracex = ">=2.1.1" [[package]] name = "yamllint" -version = "1.30.0" +version = "1.32.0" description = "A linter for YAML files." -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "yamllint-1.30.0.tar.gz", hash = "sha256:4f58f323aedda16189a489d183ecc25c66d7a9cc0fe88f61b650fef167b13190"}, + {file = "yamllint-1.32.0-py3-none-any.whl", hash = "sha256:d97a66e48da820829d96077d76b8dfbe6c6140f106e558dae87e81ac4e6b30b7"}, + {file = "yamllint-1.32.0.tar.gz", hash = "sha256:d01dde008c65de5b235188ab3110bebc59d18e5c65fc8a58267cd211cd9df34a"}, ] [package.dependencies] pathspec = ">=0.5.3" pyyaml = "*" -setuptools = "*" + +[package.extras] +dev = ["doc8", "flake8", "flake8-import-order", "rstcheck[sphinx]", "sphinx"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "db1fd890ad9e30d9245308dcfc2e7fe30cf86ff2e73630a112c000522793f143" +content-hash = "5c285370d6f0bfd09f8bdfb733f4f7ca73bf9c858d02a16310eb56d3e81d24b6" diff --git a/pyproject.toml b/pyproject.toml index 6c0bdc8..bbbacd1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,16 @@ [tool.poetry] name = "workstation-bootstrap" -version = "0.1.0" +version = "1.0.0" description = "" authors = ["Bruno Semperlotti "] license = "MIT" [tool.poetry.dependencies] python = "^3.11" -ansible = "7.4.0" +ansible = "8.0.0" [tool.poetry.dev-dependencies] -ansible-lint = { version = "6.14.4", markers = "platform_system != 'Windows'" } -yamllint = "1.30.0" +ansible-lint = { version = "6.17.0", markers = "platform_system != 'Windows'" } [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/roles/akamai/defaults/main.yml b/roles/akamai/defaults/main.yml new file mode 100644 index 0000000..bd48a99 --- /dev/null +++ b/roles/akamai/defaults/main.yml @@ -0,0 +1,2 @@ +--- +akamai_brew_packages: [] diff --git a/roles/akamai/files/config/.edgerc.sample b/roles/akamai/files/config/.edgerc.sample new file mode 100755 index 0000000..d29521a --- /dev/null +++ b/roles/akamai/files/config/.edgerc.sample @@ -0,0 +1,5 @@ +[default] +client_secret = +host = +access_token = +client_token = diff --git a/roles/akamai/files/shell_config/akamai.zsh b/roles/akamai/files/shell_config/akamai.zsh new file mode 100644 index 0000000..1ea3244 --- /dev/null +++ b/roles/akamai/files/shell_config/akamai.zsh @@ -0,0 +1,18 @@ +# https://github.com/akamai/akamai-docker +# https://github.com/akamai/cli#install-with-docker +alias akamai-shell='docker run -it --rm -v ${XDG_CONFIG_HOME}/akamai/.edgerc:/root/.edgerc:ro akamai/shell' +alias akamai='docker run -it --rm -v ${XDG_CONFIG_HOME}/akamai/.edgerc:/root/.edgerc:ro akamai/shell akamai' + +# Useful functions +export AKAMAI_PRAGMA_HEADERS_FULL="akamai-x-get-client-ip, akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no, akamai-x-feo-trace, akamai-x-get-request-id, akamai-x-get-cache-tags" +export AKAMAI_PRAGMA_HEADERS="akamai-x-get-client-ip, akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-cache-tags" + +function akcurl() { + curl -I -H "Pragma: ${AKAMAI_PRAGMA_HEADERS}" ${@} +} + +function akhttp() { + local _url="$1" + shift + http ${_url} Pragma:"${AKAMAI_PRAGMA_HEADERS}" ${@} +} diff --git a/roles/akamai/tasks/main.yml b/roles/akamai/tasks/main.yml new file mode 100644 index 0000000..c5599ca --- /dev/null +++ b/roles/akamai/tasks/main.yml @@ -0,0 +1,21 @@ +--- +- name: Install brew packages + ansible.builtin.package: + name: "{{ item }}" + state: latest + loop: "{{ akamai_brew_packages }}" + +- name: Copy custom configuration to {{ xdg_config_home }} + ansible.builtin.copy: + src: "./files/config/" # trailing / is important to copy only directory content and not the directory itself + dest: "{{ xdg_config_home }}/akamai" + mode: "0600" + +- name: Create shell config file in {{ shell_config_dir }} + ansible.builtin.blockinfile: + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" + insertbefore: BOF # Beginning of file + path: "{{ shell_config_dir }}/akamai.zsh" + block: "{{ lookup('ansible.builtin.file', './shell_config/akamai.zsh') }}" + mode: "0600" diff --git a/roles/alacritty/defaults/main.yml b/roles/alacritty/defaults/main.yml new file mode 100644 index 0000000..a7909f2 --- /dev/null +++ b/roles/alacritty/defaults/main.yml @@ -0,0 +1,2 @@ +--- +alacritty_brew_cask_package: alacritty diff --git a/roles/alacritty/files/config/alacritty.yml b/roles/alacritty/files/config/alacritty.yml new file mode 100644 index 0000000..0b18698 --- /dev/null +++ b/roles/alacritty/files/config/alacritty.yml @@ -0,0 +1,905 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +# Import additional configuration files +# +# Imports are loaded in order, skipping all missing files, with the importing +# file being loaded last. If a field is already present in a previous import, it +# will be replaced. +# +# All imports must either be absolute paths starting with `/`, or paths relative +# to the user's home directory starting with `~/`. +#import: +# - /path/to/alacritty.yml + +import: + # See theme repository: https://github.com/alacritty/alacritty-theme.git + - ~/.config/alacritty/themes/themes/breeze.yaml + +# Any items in the `env` entry below will be added as +# environment variables. Some entries may override variables +# set by alacritty itself. +#env: +# TERM variable +# +# This value is used to set the `$TERM` environment variable for +# each instance of Alacritty. If it is not present, alacritty will +# check the local terminfo database and use `alacritty` if it is +# available, otherwise `xterm-256color` is used. +#TERM: alacritty + +window: + option_as_alt: None # OnlyLeft, OnlyRight, Both, None + + # Window dimensions (changes require restart) + # + # Number of lines/columns (not pixels) in the terminal. Both lines and columns + # must be non-zero for this to take effect. The number of columns must be at + # least `2`, while using a value of `0` for columns and lines will fall back + # to the window manager's recommended size + dimensions: + columns: 160 + lines: 40 + + # Window position (changes require restart) + # + # Specified in number of pixels. + # If the position is not set, the window manager will handle the placement. + #position: + # x: 0 + # y: 0 + + # Window padding (changes require restart) + # + # Blank space added around the window in pixels. This padding is scaled + # by DPI and the specified value is always added at both opposing sides. + #padding: + # x: 0 + # y: 0 + + # Spread additional padding evenly around the terminal content. + dynamic_padding: true + + # Window decorations + # + # Values for `decorations`: + # - full: Borders and title bar + # - none: Neither borders nor title bar + # + # Values for `decorations` (macOS only): + # - transparent: Title bar, transparent background and title bar buttons + # - buttonless: Title bar, transparent background and no title bar buttons + #decorations: full + + # Background opacity + # + # Window opacity as a floating point number from `0.0` to `1.0`. + # The value `0.0` is completely transparent and `1.0` is opaque. + opacity: 0.90 + + # Startup Mode (changes require restart) + # + # Values for `startup_mode`: + # - Windowed + # - Maximized + # - Fullscreen + # + # Values for `startup_mode` (macOS only): + # - SimpleFullscreen + #startup_mode: Windowed + + # Window title + #title: Alacritty + + # Allow terminal applications to change Alacritty's window title. + #dynamic_title: true + + # Window class (Linux/BSD only): + #class: + # Application instance name + #instance: Alacritty + # General application class + #general: Alacritty + + # Decorations theme variant (Linux/BSD only) + # + # Override the variant of the GTK theme/Wayland client side decorations. + # Commonly supported values are `dark` and `light`. Set this to `None` to use + # the default theme variant. + #decorations_theme_variant: None + +scrolling: + # Maximum number of lines in the scrollback buffer. + # Specifying '0' will disable scrolling. + history: 100000 + + # Scrolling distance multiplier. + multiplier: 3 + +# Font configuration +font: + # Normal (roman) font face + normal: + # Font family + # + # Default: + # - (macOS) Menlo + # - (Linux/BSD) monospace + # - (Windows) Consolas + family: JetBrainsMono Nerd Font + # The `style` can be specified to pick a specific face. + style: Regular + + # Bold font face + bold: + # Font family + # + # If the bold family is not specified, it will fall back to the + # value specified for the normal font. + family: JetBrainsMono Nerd Font + + # The `style` can be specified to pick a specific face. + style: Bold + + # Italic font face + italic: + # Font family + # + # If the italic family is not specified, it will fall back to the + # value specified for the normal font. + family: JetBrainsMono Nerd Font + + # The `style` can be specified to pick a specific face. + style: Italic + + # Bold italic font face + bold_italic: + # Font family + # + # If the bold italic family is not specified, it will fall back to the + # value specified for the normal font. + family: JetBrainsMono Nerd Font + + # The `style` can be specified to pick a specific face. + style: Bold Italic + + # Point size + size: 12.0 + + # Offset is the extra space around each character. `offset.y` can be thought + # of as modifying the line spacing, and `offset.x` as modifying the letter + # spacing. + #offset: + # x: 0 + # y: 0 + + # Glyph offset determines the locations of the glyphs within their cells with + # the default being at the bottom. Increasing `x` moves the glyph to the + # right, increasing `y` moves the glyph upward. + #glyph_offset: + # x: 0 + # y: 0 + + # Use built-in font for box drawing characters. + # + # If `true`, Alacritty will use a custom built-in font for box drawing + # characters (Unicode points 2500 - 259f). + # + #builtin_box_drawing: true + +# If `true`, bold text is drawn using the bright color variants. +#draw_bold_text_with_bright_colors: false + +# Colors (Tomorrow Night) +#colors: +# Default colors +#primary: +# background: '#1d1f21' +# foreground: '#c5c8c6' + +# Bright and dim foreground colors +# +# The dimmed foreground color is calculated automatically if it is not +# present. If the bright foreground color is not set, or +# `draw_bold_text_with_bright_colors` is `false`, the normal foreground +# color will be used. +#dim_foreground: '#828482' +#bright_foreground: '#eaeaea' + +# Cursor colors +# +# Colors which should be used to draw the terminal cursor. +# +# Allowed values are CellForeground/CellBackground, which reference the +# affected cell, or hexadecimal colors like #ff00ff. +#cursor: +# text: CellBackground +# cursor: CellForeground + +# Vi mode cursor colors +# +# Colors for the cursor when the vi mode is active. +# +# Allowed values are CellForeground/CellBackground, which reference the +# affected cell, or hexadecimal colors like #ff00ff. +#vi_mode_cursor: +# text: CellBackground +# cursor: CellForeground + +# Search colors +# +# Colors used for the search bar and match highlighting. +#search: +# Allowed values are CellForeground/CellBackground, which reference the +# affected cell, or hexadecimal colors like #ff00ff. +#matches: +# foreground: '#000000' +# background: '#ffffff' +#focused_match: +# foreground: '#ffffff' +# background: '#000000' + +# Keyboard hints +#hints: +# First character in the hint label +# +# Allowed values are CellForeground/CellBackground, which reference the +# affected cell, or hexadecimal colors like #ff00ff. +#start: +# foreground: '#1d1f21' +# background: '#e9ff5e' + +# All characters after the first one in the hint label +# +# Allowed values are CellForeground/CellBackground, which reference the +# affected cell, or hexadecimal colors like #ff00ff. +#end: +# foreground: '#e9ff5e' +# background: '#1d1f21' + +# Line indicator +# +# Color used for the indicator displaying the position in history during +# search and vi mode. +# +# By default, these will use the opposing primary color. +#line_indicator: +# foreground: None +# background: None + +# Footer bar +# +# Color used for the footer bar on the bottom, used by search regex input, +# hyperlink URI preview, etc. +# +#footer_bar: +# background: '#c5c8c6' +# foreground: '#1d1f21' + +# Selection colors +# +# Colors which should be used to draw the selection area. +# +# Allowed values are CellForeground/CellBackground, which reference the +# affected cell, or hexadecimal colors like #ff00ff. +#selection: +# text: CellBackground +# background: CellForeground + +# Normal colors +#normal: +# black: '#1d1f21' +# red: '#cc6666' +# green: '#b5bd68' +# yellow: '#f0c674' +# blue: '#81a2be' +# magenta: '#b294bb' +# cyan: '#8abeb7' +# white: '#c5c8c6' + +# Bright colors +#bright: +# black: '#666666' +# red: '#d54e53' +# green: '#b9ca4a' +# yellow: '#e7c547' +# blue: '#7aa6da' +# magenta: '#c397d8' +# cyan: '#70c0b1' +# white: '#eaeaea' + +# Dim colors +# +# If the dim colors are not set, they will be calculated automatically based +# on the `normal` colors. +#dim: +# black: '#131415' +# red: '#864343' +# green: '#777c44' +# yellow: '#9e824c' +# blue: '#556a7d' +# magenta: '#75617b' +# cyan: '#5b7d78' +# white: '#828482' + +# Indexed Colors +# +# The indexed colors include all colors from 16 to 256. +# When these are not set, they're filled with sensible defaults. +# +# Example: +# `- { index: 16, color: '#ff00ff' }` +# +#indexed_colors: [] + +# Transparent cell backgrounds +# +# Whether or not `window.opacity` applies to all cell backgrounds or only to +# the default background. When set to `true` all cells will be transparent +# regardless of their background color. +#transparent_background_colors: false + +# Bell +# +# The bell is rung every time the BEL control character is received. +#bell: +# Visual Bell Animation +# +# Animation effect for flashing the screen when the visual bell is rung. +# +# Values for `animation`: +# - Ease +# - EaseOut +# - EaseOutSine +# - EaseOutQuad +# - EaseOutCubic +# - EaseOutQuart +# - EaseOutQuint +# - EaseOutExpo +# - EaseOutCirc +# - Linear +#animation: EaseOutExpo + +# Duration of the visual bell flash in milliseconds. A `duration` of `0` will +# disable the visual bell animation. +#duration: 0 + +# Visual bell animation color. +#color: '#ffffff' + +# Bell Command +# +# This program is executed whenever the bell is rung. +# +# When set to `command: None`, no command will be executed. +# +# Example: +# command: +# program: notify-send +# args: ["Hello, World!"] +# +#command: None + +selection: + # This string contains all characters that are used as separators for + # "semantic words" in Alacritty. + semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" + + # When set to `true`, selected text will be copied to the primary clipboard. + save_to_clipboard: false +#cursor: +# Cursor style +#style: +# Cursor shape +# +# Values for `shape`: +# - ▇ Block +# - _ Underline +# - | Beam +#shape: Block + +# Cursor blinking state +# +# Values for `blinking`: +# - Never: Prevent the cursor from ever blinking +# - Off: Disable blinking by default +# - On: Enable blinking by default +# - Always: Force the cursor to always blink +#blinking: Off + +# Vi mode cursor style +# +# If the vi mode cursor style is `None` or not specified, it will fall back to +# the style of the active value of the normal cursor. +# +# See `cursor.style` for available options. +#vi_mode_style: None + +# Cursor blinking interval in milliseconds. +#blink_interval: 750 + +# Time after which cursor stops blinking, in seconds. +# +# Specifying '0' will disable timeout for blinking. +#blink_timeout: 5 + +# If this is `true`, the cursor will be rendered as a hollow box when the +# window is not focused. +#unfocused_hollow: true + +# Thickness of the cursor relative to the cell width as floating point number +# from `0.0` to `1.0`. +#thickness: 0.15 + +# Live config reload (changes require restart) +#live_config_reload: true + +# Shell +# +# You can set `shell.program` to the path of your favorite shell, e.g. +# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the +# shell. +# +# Default: +# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset +# - (Windows) powershell +#shell: +# program: /bin/bash +# args: +# - --login + +# Startup directory +# +# Directory the shell is started in. If this is unset, or `None`, the working +# directory of the parent process will be used. +#working_directory: None + +# Send ESC (\x1b) before characters when alt is pressed. +#alt_send_esc: true + +# Offer IPC using `alacritty msg` (unix only) +#ipc_socket: true + +#mouse: +# Click settings +# +# The `double_click` and `triple_click` settings control the time +# alacritty should wait for accepting multiple clicks as one double +# or triple click. +#double_click: { threshold: 300 } +#triple_click: { threshold: 300 } + +# If this is `true`, the cursor is temporarily hidden when typing. +#hide_when_typing: false + +# Hints +# +# Terminal hints can be used to find text or hyperlink in the visible part of +# the terminal and pipe it to other applications. +#hints: +# Keys used for the hint labels. +#alphabet: "jfkdls;ahgurieowpq" + +# List with all available hints +# +# Each hint must have any of `regex` or `hyperlinks` field and either an +# `action` or a `command` field. The fields `mouse`, `binding` and +# `post_processing` are optional. +# +# The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be +# highlighted. +# +# The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and +# `mouse.mods` accept the same values as they do in the `key_bindings` section. +# +# The `mouse.enabled` field controls if the hint should be underlined while +# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it. +# +# If the `post_processing` field is set to `true`, heuristics will be used to +# shorten the match if there are characters likely not to be part of the hint +# (e.g. a trailing `.`). This is most useful for URIs and applies only to +# `regex` matches. +# +# Values for `action`: +# - Copy +# Copy the hint's text to the clipboard. +# - Paste +# Paste the hint's text to the terminal or search. +# - Select +# Select the hint's text. +# - MoveViModeCursor +# Move the vi mode cursor to the beginning of the hint. +#enabled: +# - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ +# [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" +# hyperlinks: true +# command: xdg-open +# post_processing: true +# mouse: +# enabled: true +# mods: None +# binding: +# key: U +# mods: Control|Shift + +# Mouse bindings +# +# Mouse bindings are specified as a list of objects, much like the key +# bindings further below. +# +# To trigger mouse bindings when an application running within Alacritty +# captures the mouse, the `Shift` modifier is automatically added as a +# requirement. +# +# Each mouse binding will specify a: +# +# - `mouse`: +# +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# - `action` (see key bindings for actions not exclusive to mouse mode) +# +# - Mouse exclusive actions: +# +# - ExpandSelection +# Expand the selection to the current mouse cursor location. +# +# And optionally: +# +# - `mods` (see key bindings) +#mouse_bindings: +# - { mouse: Right, action: ExpandSelection } +# - { mouse: Right, mods: Control, action: ExpandSelection } +# - { mouse: Middle, mode: ~Vi, action: PasteSelection } + +# Key bindings +# +# Key bindings are specified as a list of objects. For example, this is the +# default paste binding: +# +# `- { key: V, mods: Control|Shift, action: Paste }` +# +# Each key binding will specify a: +# +# - `key`: Identifier of the key pressed +# +# - A-Z +# - F1-F24 +# - Key0-Key9 +# +# A full list with available key codes can be found here: +# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants +# +# Instead of using the name of the keys, the `key` field also supports using +# the scancode of the desired key. Scancodes have to be specified as a +# decimal number. This command will allow you to display the hex scancodes +# for certain keys: +# +# `showkey --scancodes`. +# +# Then exactly one of: +# +# - `chars`: Send a byte sequence to the running application +# +# The `chars` field writes the specified string to the terminal. This makes +# it possible to pass escape sequences. To find escape codes for bindings +# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside +# of tmux. Note that applications use terminfo to map escape sequences back +# to keys. It is therefore required to update the terminfo when changing an +# escape sequence. +# +# - `action`: Execute a predefined action +# +# - ToggleViMode +# - SearchForward +# Start searching toward the right of the search origin. +# - SearchBackward +# Start searching toward the left of the search origin. +# - Copy +# - Paste +# - IncreaseFontSize +# - DecreaseFontSize +# - ResetFontSize +# - ScrollPageUp +# - ScrollPageDown +# - ScrollHalfPageUp +# - ScrollHalfPageDown +# - ScrollLineUp +# - ScrollLineDown +# - ScrollToTop +# - ScrollToBottom +# - ClearHistory +# Remove the terminal's scrollback history. +# - Hide +# Hide the Alacritty window. +# - Minimize +# Minimize the Alacritty window. +# - Quit +# Quit Alacritty. +# - ToggleFullscreen +# - SpawnNewInstance +# Spawn a new instance of Alacritty. +# - CreateNewWindow +# Create a new Alacritty window from the current process. +# - ClearLogNotice +# Clear Alacritty's UI warning and error notice. +# - ClearSelection +# Remove the active selection. +# - ReceiveChar +# - None +# +# - Vi mode exclusive actions: +# +# - Open +# Perform the action of the first matching hint under the vi mode cursor +# with `mouse.enabled` set to `true`. +# - ToggleNormalSelection +# - ToggleLineSelection +# - ToggleBlockSelection +# - ToggleSemanticSelection +# Toggle semantic selection based on `selection.semantic_escape_chars`. +# - CenterAroundViCursor +# Center view around vi mode cursor +# +# - Vi mode exclusive cursor motion actions: +# +# - Up +# One line up. +# - Down +# One line down. +# - Left +# One character left. +# - Right +# One character right. +# - First +# First column, or beginning of the line when already at the first column. +# - Last +# Last column, or beginning of the line when already at the last column. +# - FirstOccupied +# First non-empty cell in this terminal row, or first non-empty cell of +# the line when already at the first cell of the row. +# - High +# Top of the screen. +# - Middle +# Center of the screen. +# - Low +# Bottom of the screen. +# - SemanticLeft +# Start of the previous semantically separated word. +# - SemanticRight +# Start of the next semantically separated word. +# - SemanticLeftEnd +# End of the previous semantically separated word. +# - SemanticRightEnd +# End of the next semantically separated word. +# - WordLeft +# Start of the previous whitespace separated word. +# - WordRight +# Start of the next whitespace separated word. +# - WordLeftEnd +# End of the previous whitespace separated word. +# - WordRightEnd +# End of the next whitespace separated word. +# - Bracket +# Character matching the bracket at the cursor's location. +# - SearchNext +# Beginning of the next match. +# - SearchPrevious +# Beginning of the previous match. +# - SearchStart +# Start of the match to the left of the vi mode cursor. +# - SearchEnd +# End of the match to the right of the vi mode cursor. +# +# - Search mode exclusive actions: +# - SearchFocusNext +# Move the focus to the next search match. +# - SearchFocusPrevious +# Move the focus to the previous search match. +# - SearchConfirm +# - SearchCancel +# - SearchClear +# Reset the search regex. +# - SearchDeleteWord +# Delete the last word in the search regex. +# - SearchHistoryPrevious +# Go to the previous regex in the search history. +# - SearchHistoryNext +# Go to the next regex in the search history. +# +# - macOS exclusive actions: +# - ToggleSimpleFullscreen +# Enter fullscreen without occupying another space. +# +# - Linux/BSD exclusive actions: +# +# - CopySelection +# Copy from the selection buffer. +# - PasteSelection +# Paste from the selection buffer. +# +# - `command`: Fork and execute a specified command plus arguments +# +# The `command` field must be a map containing a `program` string and an +# `args` array of command line parameter strings. For example: +# `{ program: "alacritty", args: ["-e", "vttest"] }` +# +# And optionally: +# +# - `mods`: Key modifiers to filter binding actions +# +# - Command +# - Control +# - Option +# - Super +# - Shift +# - Alt +# +# Multiple `mods` can be combined using `|` like this: +# `mods: Control|Shift`. +# Whitespace and capitalization are relevant and must match the example. +# +# - `mode`: Indicate a binding for only specific terminal reported modes +# +# This is mainly used to send applications the correct escape sequences +# when in different modes. +# +# - AppCursor +# - AppKeypad +# - Search +# - Alt +# - Vi +# +# A `~` operator can be used before a mode to apply the binding whenever +# the mode is *not* active, e.g. `~Alt`. +# +# Bindings are always filled by default, but will be replaced when a new +# binding with the same triggers is defined. To unset a default binding, it can +# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for +# a no-op if you do not wish to receive input characters for that binding. +# +# If the same trigger is assigned to multiple actions, all of them are executed +# in the order they were defined in. +key_bindings: + #- { key: Paste, action: Paste } + #- { key: Copy, action: Copy } + #- { key: L, mods: Control, action: ClearLogNotice } + #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp } + #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } + #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop } + #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } + + # Vi Mode + #- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode } + #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } + #- { key: Escape, mode: Vi|~Search, action: ClearSelection } + #- { key: I, mode: Vi|~Search, action: ToggleViMode } + #- { key: I, mode: Vi|~Search, action: ScrollToBottom } + #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } + #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } + #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } + #- { key: G, mode: Vi|~Search, action: ScrollToTop } + #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } + #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } + #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } + #- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } + #- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } + #- { key: Y, mode: Vi|~Search, action: Copy } + #- { key: Y, mode: Vi|~Search, action: ClearSelection } + #- { key: Copy, mode: Vi|~Search, action: ClearSelection } + #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } + #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } + #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } + #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } + #- { key: Return, mode: Vi|~Search, action: Open } + #- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor } + #- { key: K, mode: Vi|~Search, action: Up } + #- { key: J, mode: Vi|~Search, action: Down } + #- { key: H, mode: Vi|~Search, action: Left } + #- { key: L, mode: Vi|~Search, action: Right } + #- { key: Up, mode: Vi|~Search, action: Up } + #- { key: Down, mode: Vi|~Search, action: Down } + #- { key: Left, mode: Vi|~Search, action: Left } + #- { key: Right, mode: Vi|~Search, action: Right } + #- { key: Key0, mode: Vi|~Search, action: First } + #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } + #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } + #- { key: H, mods: Shift, mode: Vi|~Search, action: High } + #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } + #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } + #- { key: B, mode: Vi|~Search, action: SemanticLeft } + #- { key: W, mode: Vi|~Search, action: SemanticRight } + #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } + #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } + #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } + #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } + #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } + #- { key: Slash, mode: Vi|~Search, action: SearchForward } + #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } + #- { key: N, mode: Vi|~Search, action: SearchNext } + #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } + + # Search Mode + #- { key: Return, mode: Search|Vi, action: SearchConfirm } + #- { key: Escape, mode: Search, action: SearchCancel } + #- { key: C, mods: Control, mode: Search, action: SearchCancel } + #- { key: U, mods: Control, mode: Search, action: SearchClear } + #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } + #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } + #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } + #- { key: Up, mode: Search, action: SearchHistoryPrevious } + #- { key: Down, mode: Search, action: SearchHistoryNext } + #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } + #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } + + # (Windows, Linux, and BSD only) + #- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste } + #- { key: C, mods: Control|Shift, action: Copy } + #- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward } + #- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward } + #- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection } + #- { key: Insert, mods: Shift, action: PasteSelection } + #- { key: Key0, mods: Control, action: ResetFontSize } + #- { key: Equals, mods: Control, action: IncreaseFontSize } + #- { key: Plus, mods: Control, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } + #- { key: Minus, mods: Control, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } + + # (Windows only) + #- { key: Return, mods: Alt, action: ToggleFullscreen } + + # (macOS only) + #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } + #- { key: Key0, mods: Command, action: ResetFontSize } + #- { key: Equals, mods: Command, action: IncreaseFontSize } + #- { key: Plus, mods: Command, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } + #- { key: Minus, mods: Command, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } + #- { key: V, mods: Command, action: Paste } + #- { key: C, mods: Command, action: Copy } + #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } + #- { key: H, mods: Command, action: Hide } + #- { key: H, mods: Command|Alt, action: HideOtherApplications } + #- { key: M, mods: Command, action: Minimize } + #- { key: Q, mods: Command, action: Quit } + #- { key: W, mods: Command, action: Quit } + #- { key: N, mods: Command, action: SpawnNewInstance } + #- { key: F, mods: Command|Control, action: ToggleFullscreen } + #- { key: F, mods: Command, mode: ~Search, action: SearchForward } + #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } + - { key: Left, mods: Option, chars: "\x1bb" } # Skip word left + - { key: Right, mods: Option, chars: "\x1bf" } # Skip word right + - { key: Left, mods: Command, chars: "\x1bOH", mode: AppCursor } # Home + - { key: Right, mods: Command, chars: "\x1bOF", mode: AppCursor } # End + - { key: Back, mods: Command, chars: "\x15" } # Delete line + - { key: Back, mods: Option, chars: "\x1b\x7f" } # Delete word + +#debug: +# Display the time it takes to redraw each frame. +#render_timer: false + +# Keep the log file after quitting Alacritty. +#persistent_logging: false + +# Log level +# +# Values for `log_level`: +# - Off +# - Error +# - Warn +# - Info +# - Debug +# - Trace +#log_level: Warn + +# Print all received window events. +#print_events: false + +# Highlight window damage information. +#highlight_damage: false diff --git a/roles/alacritty/tasks/main.yml b/roles/alacritty/tasks/main.yml new file mode 100644 index 0000000..5be95c1 --- /dev/null +++ b/roles/alacritty/tasks/main.yml @@ -0,0 +1,19 @@ +--- +- name: Install brew packages + community.general.homebrew_cask: + name: "{{ alacritty_brew_cask_package }}" + state: latest + install_options: "no-quarantine" + +- name: Copy Custom alacritty configuration to {{ xdg_config_home }} + ansible.builtin.copy: + src: "./files/config/" # trailing / is important to copy only files within the directory + dest: "{{ xdg_config_home }}/alacritty" + mode: "0600" + +- name: Clone theme repository + ansible.builtin.git: + repo: https://github.com/alacritty/alacritty-theme.git + dest: "{{ xdg_config_home }}/alacritty/themes" + single_branch: true + version: master diff --git a/roles/azure/defaults/main.yml b/roles/azure/defaults/main.yml index 329beff..bd2bd49 100644 --- a/roles/azure/defaults/main.yml +++ b/roles/azure/defaults/main.yml @@ -1,5 +1,3 @@ --- azure_brew_packages: - azure-cli -azure_linux_packages: [] -azure_shell_config_file: "" diff --git a/roles/azure/files/shell_config/azure.zsh b/roles/azure/files/shell_config/azure.zsh new file mode 100644 index 0000000..8d8e0d5 --- /dev/null +++ b/roles/azure/files/shell_config/azure.zsh @@ -0,0 +1 @@ +export AZURE_CONFIG_DIR=${XDG_CONFIG_HOME}/azure diff --git a/roles/azure/tasks/linux_install.yml b/roles/azure/tasks/linux_install.yml deleted file mode 100644 index 6f5fd51..0000000 --- a/roles/azure/tasks/linux_install.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- ansible.builtin.debug: - msg: "Not yet supported" diff --git a/roles/azure/tasks/main.yml b/roles/azure/tasks/main.yml index 0f60636..15800a3 100644 --- a/roles/azure/tasks/main.yml +++ b/roles/azure/tasks/main.yml @@ -1,49 +1,15 @@ --- -- name: Select macos packages - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - azure_packages: "{{ azure_brew_packages }}" - -- name: Select linux packages - when: ansible_system == "Linux" - ansible.builtin.set_fact: - azure_packages: "{{ azure_linux_packages }}" - -- name: Install azure tools +- name: Install brew packages ansible.builtin.package: name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" - loop: "{{ azure_packages }}" - -- name: Install azure tools on linux (no package manager) - when: - - ansible_system == "Linux" - - not azure_linux_packages - ansible.builtin.import_tasks: ./linux_install.yml - -- name: Manage configuration file - when: azure_shell_config_file != "" - block: - - name: Check config files exists - ansible.builtin.stat: - path: "{{ azure_shell_config_file }}" - register: file_details - - - name: Ensure config files exists - when: not file_details.stat.exists - ansible.builtin.file: - path: "{{ azure_shell_config_file }}" - state: touch - mode: 0600 - - - name: Create config file - ansible.builtin.blockinfile: - marker: "# {mark} - azure - ANSIBLE MANAGED BLOCK" - insertafter: EOF - path: "{{ azure_shell_config_file }}" - block: | - # Load azure-cli bash_completion - if [ -s "/usr/local/opt/azure-cli/etc/bash_completion.d/az" ]; then - source "/usr/local/opt/azure-cli/etc/bash_completion.d/az" - fi + loop: "{{ azure_brew_packages }}" + +- name: Create shell config file in {{ shell_config_dir }} + ansible.builtin.blockinfile: + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" + insertbefore: BOF # Beginning of file + path: "{{ shell_config_dir }}/azure.zsh" + block: "{{ lookup('ansible.builtin.file', './shell_config/azure.zsh') }}" + mode: "0600" diff --git a/roles/cli_tools/defaults/main.yml b/roles/cli_tools/defaults/main.yml index 71e041e..cbde38e 100644 --- a/roles/cli_tools/defaults/main.yml +++ b/roles/cli_tools/defaults/main.yml @@ -1,38 +1,26 @@ --- -cli_tools_shell_config_file: "" - cli_tools_brew_packages: - - bat # A cat(1) clone with syntax highlighting and Git integration - - bash # Install newest bash instead of macos outdated 3.2 - - cheat # Interactive cheatsheets on the command-line - - curl # Get a file from an HTTP, HTTPS or FTP server - - exa # A modern replacement for ls - - fzf # A command-line fuzzy finder - - gum # A tool for glamorous shell scripts. https://github.com/charmbracelet/gum - - hping # Command-line oriented TCP/IP packet assembler/analyzer - - httpie # User-friendly cURL replacement (command-line HTTP client) - - ipcalc # IP subnet calculator - - jq # Lightweight and flexible command-line JSON processor - - jsonnet # Domain specific configuration language for defining JSON data - - openssl # Cryptography and SSL/TLS Toolkit - - tig # A text-mode interface for git - - tmux # Terminal multiplexer - - the_silver_searcher # A code searching tool similar to ack, with a focus on speed. - - tree # Display directories as trees (with optional color/HTML output) - - wget # Internet file retriever - - zoxide # zoxide is a smarter cd command, inspired by z and autojump. - -cli_tools_linux_packages: - - curl - # - exa # Only available in packaga manager in ubuntu 20.10+ - - fzf - - hping3 - - httpie - - jq - - jsonnet - - openssl - - snapd - - tmux - - tree - - wget - # - zoxide # Only available in packaga manager in ubuntu 21.04+ + - bash # Install newest bash instead of macos outdated + - bat # A cat(1) clone with syntax highlighting and Git integration + - cheat # Interactive cheatsheets on the command-line + - coreutils # GNU File, Shell, and Text utilities + - curl # Get a file from an HTTP, HTTPS or FTP server + - exa # A modern replacement for ls + - fzf # A command-line fuzzy finder + - gnu-getopt # Command-line option parsing utility + - grep # GNU grep, egrep and fgrep + - gum # A tool for glamorous shell scripts. https://github.com/charmbracelet/gum + - hping # Command-line oriented TCP/IP packet assembler/analyzer + - httpie # User-friendly cURL replacement (command-line HTTP client) + - ipcalc # IP subnet calculator + - jq # Lightweight and flexible command-line JSON processor + - jsonnet # Domain specific configuration language for defining JSON data + - openssl # Cryptography and SSL/TLS Toolkit + - screen # Terminal multiplexer + - the_silver_searcher # A code searching tool similar to ack, with a focus on speed. + - tree # Display directories as trees (with optional color/HTML output) + - watch # Executes a program periodically, showing output fullscreen + - wget # Internet file retriever + - yq # Process YAML, JSON, XML, CSV and properties documents from the CLI + - zellij # Pluggable terminal workspace, with terminal multiplexer as the base feature (https://zellij.dev/) + - zoxide # zoxide is a smarter cd command, inspired by z and autojump. diff --git a/roles/cli_tools/files/xdg_config_home/curl/.curlrc b/roles/cli_tools/files/config/curl/.curlrc similarity index 100% rename from roles/cli_tools/files/xdg_config_home/curl/.curlrc rename to roles/cli_tools/files/config/curl/.curlrc diff --git a/roles/screen/files/.screenrc b/roles/cli_tools/files/config/screen/.screenrc similarity index 100% rename from roles/screen/files/.screenrc rename to roles/cli_tools/files/config/screen/.screenrc diff --git a/roles/cli_tools/files/config/starship/starship.toml b/roles/cli_tools/files/config/starship/starship.toml new file mode 100644 index 0000000..a48747a --- /dev/null +++ b/roles/cli_tools/files/config/starship/starship.toml @@ -0,0 +1,103 @@ +# https://starship.rs/config/ +# https://github.com/dracula/starship/blob/master/starship.toml + +# Get editor completions based on the config schema +'$schema' = 'https://starship.rs/config-schema.json' + +add_newline = true + +format = """ +$cmd_duration\ +$line_break\ +$os\ +$all\ +$fill\ +$kubernetes\ +$azure\ +$aws\ +$gcloud\ +$line_break\ +$character\ +""" + +[cmd_duration] +format = '[\[took $duration\]]($style) ' + +[line_break] +disabled = false + +[fill] +disabled = false +symbol = ' ' + +[git_status] +ahead = '⇡${count}' +diverged = '⇕⇡${ahead_count}⇣${behind_count}' +behind = '⇣${count}' + +[directory] +disabled = false +truncation_length = 3 +truncation_symbol = '[…]/' + +[docker_context] +symbol = ' ' + +[os] +disabled = false +[os.symbols] +Windows = ' ' +Macos = ' ' +Linux = ' ' +Ubuntu = ' ' + +[kubernetes] +disabled = false +format = '[$symbol$context( \($namespace\))]($style) ' +symbol = '󱃾 ' + +[aws] +disabled = false +format = '[$symbol($profile )(\($region\) )(\[$duration\] )]($style)' +symbol = '󰸏 ' + +[azure] +disabled = false +format = '[$symbol($subscription)]($style) ' +symbol = '󰠅 ' + +[gcloud] +disabled = false +format = '[$symbol$account(@$domain)(\($region\))]($style) ' +symbol = '󱇶 ' + +[terraform] +disabled = false +format = '[$symbol$workspace]($style) ' +symbol = '󱁢 ' + +[python] +disabled = false +symbol = ' ' + +[nodejs] +disabled = false +symbol = ' ' + +[env_var] +disabled = true + +[package] +disabled = true + +[battery] +full_symbol = ' ' +charging_symbol = ' ' +discharging_symbol = ' ' +disabled = false +[[battery.display]] +threshold = 15 +style = 'bold red' +[[battery.display]] +threshold = 40 +style = 'bold yellow' diff --git a/roles/cli_tools/files/config/zellij/config.kdl b/roles/cli_tools/files/config/zellij/config.kdl new file mode 100644 index 0000000..a1a48b1 --- /dev/null +++ b/roles/cli_tools/files/config/zellij/config.kdl @@ -0,0 +1,325 @@ +// https://zellij.dev/documentation/options.html + +// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true" +keybinds { + normal { + // uncomment this and adjust key if using copy_on_select=false + // bind "Alt c" { Copy; } + } + locked { + bind "Ctrl g" { SwitchToMode "Normal"; } + } + resize { + bind "Ctrl n" { SwitchToMode "Normal"; } + bind "h" "Left" { Resize "Increase Left"; } + bind "j" "Down" { Resize "Increase Down"; } + bind "k" "Up" { Resize "Increase Up"; } + bind "l" "Right" { Resize "Increase Right"; } + bind "H" { Resize "Decrease Left"; } + bind "J" { Resize "Decrease Down"; } + bind "K" { Resize "Decrease Up"; } + bind "L" { Resize "Decrease Right"; } + bind "=" "+" { Resize "Increase"; } + bind "-" { Resize "Decrease"; } + } + pane { + bind "Ctrl p" { SwitchToMode "Normal"; } + bind "h" "Left" { MoveFocus "Left"; } + bind "l" "Right" { MoveFocus "Right"; } + bind "j" "Down" { MoveFocus "Down"; } + bind "k" "Up" { MoveFocus "Up"; } + bind "p" { SwitchFocus; } + bind "n" { NewPane; SwitchToMode "Normal"; } + bind "d" { NewPane "Down"; SwitchToMode "Normal"; } + bind "r" { NewPane "Right"; SwitchToMode "Normal"; } + bind "x" { CloseFocus; SwitchToMode "Normal"; } + bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; } + bind "z" { TogglePaneFrames; SwitchToMode "Normal"; } + bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; } + bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; } + bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;} + } + move { + bind "Ctrl h" { SwitchToMode "Normal"; } + bind "n" "Tab" { MovePane; } + bind "p" { MovePaneBackwards; } + bind "h" "Left" { MovePane "Left"; } + bind "j" "Down" { MovePane "Down"; } + bind "k" "Up" { MovePane "Up"; } + bind "l" "Right" { MovePane "Right"; } + } + tab { + bind "Ctrl t" { SwitchToMode "Normal"; } + bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; } + bind "h" "Left" "Up" "k" { GoToPreviousTab; } + bind "l" "Right" "Down" "j" { GoToNextTab; } + bind "n" { NewTab; SwitchToMode "Normal"; } + bind "x" { CloseTab; SwitchToMode "Normal"; } + bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; } + bind "1" { GoToTab 1; SwitchToMode "Normal"; } + bind "2" { GoToTab 2; SwitchToMode "Normal"; } + bind "3" { GoToTab 3; SwitchToMode "Normal"; } + bind "4" { GoToTab 4; SwitchToMode "Normal"; } + bind "5" { GoToTab 5; SwitchToMode "Normal"; } + bind "6" { GoToTab 6; SwitchToMode "Normal"; } + bind "7" { GoToTab 7; SwitchToMode "Normal"; } + bind "8" { GoToTab 8; SwitchToMode "Normal"; } + bind "9" { GoToTab 9; SwitchToMode "Normal"; } + bind "Tab" { ToggleTab; } + } + scroll { + bind "Ctrl s" { SwitchToMode "Normal"; } + bind "e" { EditScrollback; SwitchToMode "Normal"; } + bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; } + bind "j" "Down" { ScrollDown; } + bind "k" "Up" { ScrollUp; } + bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } + bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } + bind "d" { HalfPageScrollDown; } + bind "u" { HalfPageScrollUp; } + // uncomment this and adjust key if using copy_on_select=false + // bind "Alt c" { Copy; } + } + search { + bind "Ctrl s" { SwitchToMode "Normal"; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; } + bind "j" "Down" { ScrollDown; } + bind "k" "Up" { ScrollUp; } + bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } + bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } + bind "d" { HalfPageScrollDown; } + bind "u" { HalfPageScrollUp; } + bind "n" { Search "down"; } + bind "p" { Search "up"; } + bind "c" { SearchToggleOption "CaseSensitivity"; } + bind "w" { SearchToggleOption "Wrap"; } + bind "o" { SearchToggleOption "WholeWord"; } + } + entersearch { + bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; } + bind "Enter" { SwitchToMode "Search"; } + } + renametab { + bind "Ctrl c" { SwitchToMode "Normal"; } + bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; } + } + renamepane { + bind "Ctrl c" { SwitchToMode "Normal"; } + bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; } + } + session { + bind "Ctrl o" { SwitchToMode "Normal"; } + bind "Ctrl s" { SwitchToMode "Scroll"; } + bind "d" { Detach; } + } + tmux { + bind "[" { SwitchToMode "Scroll"; } + bind "Ctrl b" { Write 2; SwitchToMode "Normal"; } + bind "\"" { NewPane "Down"; SwitchToMode "Normal"; } + bind "%" { NewPane "Right"; SwitchToMode "Normal"; } + bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; } + bind "c" { NewTab; SwitchToMode "Normal"; } + bind "," { SwitchToMode "RenameTab"; } + bind "p" { GoToPreviousTab; SwitchToMode "Normal"; } + bind "n" { GoToNextTab; SwitchToMode "Normal"; } + bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; } + bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; } + bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; } + bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; } + bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; } + bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; } + bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; } + bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; } + bind "o" { FocusNextPane; } + bind "d" { Detach; } + bind "Space" { NextSwapLayout; } + bind "x" { CloseFocus; SwitchToMode "Normal"; } + } + shared_except "locked" { + bind "Ctrl g" { SwitchToMode "Locked"; } + bind "Ctrl q" { Quit; } + bind "Alt n" { NewPane; } + bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; } + bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; } + bind "Alt j" "Alt Down" { MoveFocus "Down"; } + bind "Alt k" "Alt Up" { MoveFocus "Up"; } + bind "Alt =" "Alt +" { Resize "Increase"; } + bind "Alt -" { Resize "Decrease"; } + bind "Alt [" { PreviousSwapLayout; } + bind "Alt ]" { NextSwapLayout; } + } + shared_except "normal" "locked" { + bind "Enter" "Esc" { SwitchToMode "Normal"; } + } + shared_except "pane" "locked" { + bind "Ctrl p" { SwitchToMode "Pane"; } + } + shared_except "resize" "locked" { + bind "Ctrl n" { SwitchToMode "Resize"; } + } + shared_except "scroll" "locked" { + bind "Ctrl s" { SwitchToMode "Scroll"; } + } + shared_except "session" "locked" { + bind "Ctrl o" { SwitchToMode "Session"; } + } + shared_except "tab" "locked" { + bind "Ctrl t" { SwitchToMode "Tab"; } + } + shared_except "move" "locked" { + bind "Ctrl h" { SwitchToMode "Move"; } + } + shared_except "tmux" "locked" { + bind "Ctrl b" { SwitchToMode "Tmux"; } + } +} + +plugins { + tab-bar { path "tab-bar"; } + status-bar { path "status-bar"; } + strider { path "strider"; } + compact-bar { path "compact-bar"; } +} + +// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP +// eg. when terminal window with an active zellij session is closed +// Options: +// - detach (Default) +// - quit +// +// on_force_close "quit" + +// Send a request for a simplified ui (without arrow fonts) to plugins +// Options: +// - true +// - false (Default) +// +// simplified_ui true + +// Choose the path to the default shell that zellij will use for opening new panes +// Default: $SHELL +// +// default_shell "fish" + +// Toggle between having pane frames around the panes +// Options: +// - true (default) +// - false +// +// pane_frames true + +// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible +// Options: +// - true (default) +// - false +// +// auto_layout true + +// Define color themes for Zellij +// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes +// Once these themes are defined, one of them should to be selected in the "theme" section of this file +// +// themes { +// dracula { +// fg 248 248 242 +// bg 40 42 54 +// red 255 85 85 +// green 80 250 123 +// yellow 241 250 140 +// blue 98 114 164 +// magenta 255 121 198 +// orange 255 184 108 +// cyan 139 233 253 +// black 0 0 0 +// white 255 255 255 +// } +// } + +// Choose the theme that is specified in the themes section. +// Default: default +// +// theme "default" + +// The name of the default layout to load on startup +// Default: "default" +// +// default_layout "compact" + +// Choose the mode that zellij uses when starting up. +// Default: normal +// +// default_mode "locked" + +// Toggle enabling the mouse mode. +// On certain configurations, or terminals this could +// potentially interfere with copying text. +// Options: +// - true (default) +// - false +// +mouse_mode true + +// Configure the scroll back buffer size +// This is the number of lines zellij stores for each pane in the scroll back +// buffer. Excess number of lines are discarded in a FIFO fashion. +// Valid values: positive integers +// Default value: 10000 +// +scroll_buffer_size 10000 + +// Provide a command to execute when copying text. The text will be piped to +// the stdin of the program to perform the copy. This can be used with +// terminal emulators which do not support the OSC 52 ANSI control sequence +// that will be used by default if this option is not set. +// Examples: +// +// copy_command "xclip -selection clipboard" // x11 +// copy_command "wl-copy" // wayland +copy_command "pbcopy" // osx + +// Choose the destination for copied text +// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard. +// Does not apply when using copy_command. +// Options: +// - system (default) +// - primary +// +// copy_clipboard "primary" + +// Enable or disable automatic copy (and clear) of selection when releasing mouse +// Default: true +// +// copy_on_select false + +// Path to the default editor to use to edit pane scrollbuffer +// Default: $EDITOR or $VISUAL +// +// scrollback_editor "/usr/bin/vim" + +// When attaching to an existing session with other users, +// should the session be mirrored (true) +// or should each user have their own cursor (false) +// Default: false +// +// mirror_session true + +// The folder in which Zellij will look for layouts +// +// layout_dir "/path/to/my/layout_dir" + +// The folder in which Zellij will look for themes +// +// theme_dir "/path/to/my/theme_dir" + +// https://zellij.dev/documentation/options.html#env +env { +} + +// https://zellij.dev/documentation/options.html#rounded_corners +ui { + pane_frames { + rounded_corners true + hide_session_name false + } +} diff --git a/roles/zsh/files/.zlogin b/roles/cli_tools/files/config/zellij/layouts/.gitkeep similarity index 100% rename from roles/zsh/files/.zlogin rename to roles/cli_tools/files/config/zellij/layouts/.gitkeep diff --git a/roles/zsh/files/.zlogout b/roles/cli_tools/files/config/zellij/themes/.gitkeep similarity index 100% rename from roles/zsh/files/.zlogout rename to roles/cli_tools/files/config/zellij/themes/.gitkeep diff --git a/roles/cli_tools/files/shell_config/exa.zsh b/roles/cli_tools/files/shell_config/exa.zsh new file mode 100644 index 0000000..30176a0 --- /dev/null +++ b/roles/cli_tools/files/shell_config/exa.zsh @@ -0,0 +1,19 @@ +########## +## exa, A modern replacement for ls +########## +if command -v exa &>/dev/null; then + # Override common ls aliases whith exa (https://the.exa.website/) if available + alias ls='exa' + alias l='exa -lbF --git' + alias la='exa -lbhHigUmuSa --time-style=long-iso --git --color-scale' + alias ll='exa -lah' + alias lt='exa --tree --level=2' +else + # Override common ls aliases + alias ls='ls -G' + alias l='ls -lFh' + alias la='ls -lAFhp' + alias ll='ls -lAhp' + alias lr='ls -tRFh' + alias lt='ls -ltFh' +fi diff --git a/roles/cli_tools/files/shell_config/fzf.zsh b/roles/cli_tools/files/shell_config/fzf.zsh new file mode 100644 index 0000000..bff5403 --- /dev/null +++ b/roles/cli_tools/files/shell_config/fzf.zsh @@ -0,0 +1,22 @@ +########## +## Fuzzy Finder +########## +if command -v fzf &>/dev/null; then + # Auto-completion + [[ $- == *i* ]] && source "$(brew --prefix)/opt/fzf/shell/completion.zsh" 2> /dev/null + + # Key bindings + source "$(brew --prefix)/opt/fzf/shell/key-bindings.zsh" + + export FZF_COMPLETION_TRIGGER='~~' + export FZF_DEFAULT_OPTS='--multi --height 50% --layout=reverse --border' + # Use The silver searcher and enable hidden files + if command -v ag &>/dev/null; then + export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""' + fi + if command -v bat &>/dev/null; then + alias fzfp='fzf --preview "bat --style=numbers --color=always --line-range :500 {}"' + else + alias fzfp='fzf --preview "cat {}"' + fi +fi diff --git a/roles/cli_tools/files/shell_config/gnu-tools.zsh b/roles/cli_tools/files/shell_config/gnu-tools.zsh new file mode 100644 index 0000000..b9fb708 --- /dev/null +++ b/roles/cli_tools/files/shell_config/gnu-tools.zsh @@ -0,0 +1,16 @@ +########## +## CURL, COREUTILS, GREP, GNU-GETOPT +########## +export CURL_HOME=${XDG_CONFIG_HOME}/curl +# Use brew installed commands instead of MacOS default's one +export PATH="$(brew --prefix)/opt/curl/bin:${PATH}" +export PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:${PATH}" +export PATH="$(brew --prefix)/opt/grep/libexec/gnubin:${PATH}" +export PATH="$(brew --prefix)/opt/gnu-getopt/bin:${PATH}" + +########## +## GNU Screen +########## +if command -v screen &>/dev/null; then + alias screen="screen -c ${XDG_CONFIG_HOME}/screen/.screenrc" +fi diff --git a/roles/cli_tools/files/shell_config/starship.zsh b/roles/cli_tools/files/shell_config/starship.zsh new file mode 100644 index 0000000..30c996b --- /dev/null +++ b/roles/cli_tools/files/shell_config/starship.zsh @@ -0,0 +1,8 @@ +########## +## Starship Prompt +########## +if command -v starship &>/dev/null; then + export STARSHIP_CONFIG="${XDG_CONFIG_HOME}/starship/starship.toml" + export STARSHIP_CACHE="${XDG_CONFIG_HOME}/starship" + eval "$(starship init zsh)" +fi diff --git a/roles/cli_tools/files/shell_config/zellij.zsh b/roles/cli_tools/files/shell_config/zellij.zsh new file mode 100644 index 0000000..c6c9022 --- /dev/null +++ b/roles/cli_tools/files/shell_config/zellij.zsh @@ -0,0 +1,10 @@ +########## +## zellij, terminal multiplexer +########## +# Autostart zellij only in alacritty terminal (prevent zellij from starting in vscode integrated terminal) +if [[ "${TERM}" == "alacritty" ]]; then + if command -v zellij &>/dev/null; then + export ZELLIJ_AUTO_ATTACH="true" + eval "$(zellij setup --generate-auto-start zsh)" + fi +fi diff --git a/roles/cli_tools/files/shell_config/zoxide.zsh b/roles/cli_tools/files/shell_config/zoxide.zsh new file mode 100644 index 0000000..127f5d7 --- /dev/null +++ b/roles/cli_tools/files/shell_config/zoxide.zsh @@ -0,0 +1,6 @@ +########## +## zoxide, smarter cd command +########## +if command -v zoxide &>/dev/null; then + eval "$(zoxide init zsh)" +fi diff --git a/roles/cli_tools/tasks/main.yml b/roles/cli_tools/tasks/main.yml index d60e0f3..e2a5866 100644 --- a/roles/cli_tools/tasks/main.yml +++ b/roles/cli_tools/tasks/main.yml @@ -1,113 +1,22 @@ --- -- name: Select macos package - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - cli_tools_packages: "{{ cli_tools_brew_packages }}" - -- name: Install epel-release - when: - - ansible_system == "Linux" - - ansible_distribution == "CentOS" - ansible.builtin.package: - name: epel-release - state: latest - become: true - -- name: Select linux package - when: ansible_system == "Linux" - ansible.builtin.set_fact: - cli_tools_packages: "{{ cli_tools_linux_packages }}" - -- name: Install cli tools +- name: Install brew packages ansible.builtin.package: name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" - loop: "{{ cli_tools_packages }}" - -- name: Get XDG_CONFIG_HOME - ansible.builtin.set_fact: - xdg_config_home: "{{ lookup('env', 'XDG_CONFIG_HOME') | default((lookup('env', 'HOME'), '.config') | path_join, True) }}" + loop: "{{ cli_tools_brew_packages }}" -- name: Copy custom configuration to xdg_config_home +- name: Copy custom configuration to {{ xdg_config_home }} ansible.builtin.copy: - src: "./files/xdg_config_home/" # trailing / is important to copy only directory content and not the directory itself + src: "./files/config/" # trailing / is important to copy only directory content and not the directory itself dest: "{{ xdg_config_home }}" - mode: 0644 - -- name: Manage configuration file - when: cli_tools_shell_config_file != "" - block: - - name: Check config files exists - ansible.builtin.stat: - path: "{{ cli_tools_shell_config_file }}" - register: file_details - - - name: Ensure config files exists - when: not file_details.stat.exists - ansible.builtin.file: - path: "{{ cli_tools_shell_config_file }}" - state: touch - mode: 0600 - - - name: Create config file - ansible.builtin.blockinfile: - marker: "# {mark} - cli-tools - ANSIBLE MANAGED BLOCK" - insertafter: EOF - path: "{{ cli_tools_shell_config_file }}" - block: | - if command -v exa &>/dev/null; then - # Override common ls aliases whith exa (https://the.exa.website/) if available - alias ls='exa' - alias l='exa -lbF --git' - alias la='exa -lbhHigUmuSa --time-style=long-iso --git --color-scale' - alias ll='exa -lah' - alias lt='exa --tree --level=2' - else - # Override common ls aliases - alias ls='ls -G' - alias l='ls -lFh' - alias la='ls -lAFhp' - alias ll='ls -lAhp' - alias lr='ls -tRFh' - alias lt='ls -ltFh' - fi - - ########## - ## Fuzzy Finder - ########## - if command -v fzf &>/dev/null; then - # Auto-completion - [[ $- == *i* ]] && source "/usr/local/opt/fzf/shell/completion.zsh" 2> /dev/null - - # Key bindings - source "/usr/local/opt/fzf/shell/key-bindings.zsh" - - export FZF_COMPLETION_TRIGGER='~~' - export FZF_DEFAULT_OPTS='--multi --height 50% --layout=reverse --border' - # Use The silver searcher and enable hidden files - if command -v ag &>/dev/null; then - export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""' - fi - if command -v bat &>/dev/null; then - alias fzfp='fzf --preview "bat --style=numbers --color=always --line-range :500 {}"' - else - alias fzfp='fzf --preview "cat {}"' - fi - fi - - ########## - ## zoxide, smarter cd command - ########## - if command -v zoxide &>/dev/null; then - eval "$(zoxide init zsh)" - fi - - ########## - ## CURL - ########## - export CURL_HOME={{ xdg_config_home }}/curl - # Use brew installed CURL instead of MacOS default's one - if command -v brew &>/dev/null; then - export PATH="$(brew --prefix)/opt/curl/bin:${PATH}" - fi + mode: "0600" + +- name: Create shell config file in {{ shell_config_dir }} + ansible.builtin.blockinfile: + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" + insertbefore: BOF # Beginning of file + path: "{{ shell_config_dir }}/{{ item | basename }}" + block: "{{ lookup('ansible.builtin.file', './shell_config/{{ item | basename }}') }}" + mode: "0600" + loop: "{{ lookup('ansible.builtin.fileglob', './shell_config/*.zsh', wantlist=True) }}" diff --git a/roles/docker/defaults/main.yml b/roles/docker/defaults/main.yml index f99f1a2..209baeb 100644 --- a/roles/docker/defaults/main.yml +++ b/roles/docker/defaults/main.yml @@ -1,8 +1,7 @@ --- -docker_shell_config_file: "" - docker_brew_packages: - podman - -docker_linux_packages: - - podman + - podman-compose + - docker-credential-helper # Use OSX keychain to store docker credentials + - trivy # Simple image security scanner: https://github.com/aquasecurity/trivy + - dive # A tool for exploring each layer in a docker image: https://github.com/wagoodman/dive diff --git a/roles/docker/files/shell_config/podman.zsh b/roles/docker/files/shell_config/podman.zsh new file mode 100644 index 0000000..d67dd39 --- /dev/null +++ b/roles/docker/files/shell_config/podman.zsh @@ -0,0 +1,9 @@ +if command -v podman &>/dev/null; then + # Override common docker command with podman + alias docker='podman' +fi + +if command -v podman-compose &>/dev/null; then + # Override common docker-compose command with podman-compose + alias docker-compose='podman-compose' +fi diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index c804454..9b7e07d 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -1,43 +1,15 @@ --- -- name: Select macos package - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - docker_packages: "{{ docker_brew_packages }}" - -- name: Select linux package - when: ansible_system == "Linux" - ansible.builtin.set_fact: - docker_packages: "{{ docker_linux_packages }}" - -- name: Install cli tools +- name: Install brew packages ansible.builtin.package: name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" - loop: "{{ docker_packages }}" - -- name: Manage configuration file - when: docker_shell_config_file != "" - block: - - name: Check config files exists - ansible.builtin.stat: - path: "{{ docker_shell_config_file }}" - register: file_details - - - name: Ensure config files exists - when: not file_details.stat.exists - ansible.builtin.file: - path: "{{ docker_shell_config_file }}" - state: touch - mode: 0600 - - - name: Create config file - ansible.builtin.blockinfile: - marker: "# {mark} - cli-tools - ANSIBLE MANAGED BLOCK" - insertafter: EOF - path: "{{ docker_shell_config_file }}" - block: | - if command -v podman &>/dev/null; then - # Override common docker command with podman - alias docker='podman' - fi + loop: "{{ docker_brew_packages }}" + +- name: Create shell config file in {{ shell_config_dir }} + ansible.builtin.blockinfile: + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" + insertbefore: BOF # Beginning of file + path: "{{ shell_config_dir }}/podman.zsh" + block: "{{ lookup('ansible.builtin.file', './shell_config/podman.zsh') }}" + mode: "0600" diff --git a/roles/fonts/defaults/main.yml b/roles/fonts/defaults/main.yml index 235d66a..60b477f 100644 --- a/roles/fonts/defaults/main.yml +++ b/roles/fonts/defaults/main.yml @@ -1,7 +1,5 @@ --- -nerd_fonts_brew_tap: homebrew/cask-fonts - -nerd_fonts_brew_packages: +fonts_brew_cask_packages: - font-fira-code-nerd-font - font-jetbrains-mono-nerd-font - font-meslo-lg-nerd-font diff --git a/roles/fonts/tasks/main.yml b/roles/fonts/tasks/main.yml index 0138407..810d9a8 100644 --- a/roles/fonts/tasks/main.yml +++ b/roles/fonts/tasks/main.yml @@ -1,13 +1,11 @@ --- -- name: Install Homebrew Cask Fonts - when: ansible_system == "Darwin" +- name: Install Homebrew tap cask-fonts community.general.homebrew_tap: - name: "{{ nerd_fonts_brew_tap }}" + name: homebrew/cask-fonts state: present -- name: Install nerd fonts - when: ansible_system == "Darwin" +- name: Install brew packages community.general.homebrew_cask: name: "{{ item }}" state: latest - loop: "{{ nerd_fonts_brew_packages }}" + loop: "{{ fonts_brew_cask_packages }}" diff --git a/roles/git/defaults/main.yml b/roles/git/defaults/main.yml index 3056c36..8e5ac42 100644 --- a/roles/git/defaults/main.yml +++ b/roles/git/defaults/main.yml @@ -1,4 +1,5 @@ --- -git_brew_package: git -git_linux_package: git -git_config_dir: "{{ lookup('env', 'HOME') }}/.config/git" +git_brew_packages: + - gh # Github cli + - git + - tig # A text-mode interface for git diff --git a/roles/git/files/dior_gitconfig b/roles/git/files/config/git/dior_gitconfig similarity index 100% rename from roles/git/files/dior_gitconfig rename to roles/git/files/config/git/dior_gitconfig diff --git a/roles/git/files/gitignore_global b/roles/git/files/config/git/gitignore_global similarity index 72% rename from roles/git/files/gitignore_global rename to roles/git/files/config/git/gitignore_global index 8e953e1..ac2fd25 100644 --- a/roles/git/files/gitignore_global +++ b/roles/git/files/config/git/gitignore_global @@ -3,3 +3,6 @@ # Backup created by a text editor or similar program *~ + +# Autoenv files +.autoenv_* diff --git a/roles/git/files/gitmessage b/roles/git/files/config/git/gitmessage similarity index 100% rename from roles/git/files/gitmessage rename to roles/git/files/config/git/gitmessage diff --git a/roles/cli_tools/files/xdg_config_home/tig/config b/roles/git/files/config/tig/config similarity index 100% rename from roles/cli_tools/files/xdg_config_home/tig/config rename to roles/git/files/config/tig/config diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index e6590a9..05eb90b 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -1,30 +1,18 @@ --- -- name: Select macos package - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - git_package: "{{ git_brew_package }}" - -- name: Select linux package - when: ansible_system == "Linux" - ansible.builtin.set_fact: - git_package: "{{ git_linux_package }}" - -- name: Install git +- name: Install brew packages ansible.builtin.package: - name: "{{ git_package }}" + name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" + loop: "{{ git_brew_packages }}" -- name: Copy Custom git configuration to {{ git_config_dir }} +- name: Copy custom configuration to {{ xdg_config_home }} ansible.builtin.copy: - src: "./files/" # trailing / is important to copy only files within the directory - dest: "{{ git_config_dir }}" - mode: 0644 + src: "./files/config/" # trailing / is important to copy only directory content and not the directory itself + dest: "{{ xdg_config_home }}" + mode: "0600" -- name: Create a symbolic link to custom .gitconfig - ansible.builtin.file: - src: "{{ git_config_dir }}/gitconfig" - dest: "~/.gitconfig" - state: link - mode: 0644 - force: true +- name: Copy custom gitconfig to {{ xdg_config_home }} + ansible.builtin.template: + src: "gitconfig.j2" + dest: "{{ xdg_config_home }}/git/config" + mode: "0600" diff --git a/roles/git/files/gitconfig b/roles/git/templates/gitconfig.j2 similarity index 81% rename from roles/git/files/gitconfig rename to roles/git/templates/gitconfig.j2 index 78f4634..66846db 100755 --- a/roles/git/files/gitconfig +++ b/roles/git/templates/gitconfig.j2 @@ -14,13 +14,13 @@ [pull] rebase = true [core] - excludesfile = ~/.config/git/gitignore_global + excludesfile = {{ xdg_config_home }}/git/gitignore_global [commit] gpgsign = true - template = ~/.config/git/gitmessage + template = {{ xdg_config_home }}/git/gitmessage [gpg] - program = /usr/local/bin/gpg + program = {{ homebrew_prefix }}/bin/gpg # Override configuration according git directories [includeIf "gitdir:~/workspaces/dior/"] - path = ~/.config/git/dior_gitconfig + path = {{ xdg_config_home }}/git/dior_gitconfig diff --git a/roles/gnu_tools/defaults/main.yml b/roles/gnu_tools/defaults/main.yml deleted file mode 100644 index 88ca812..0000000 --- a/roles/gnu_tools/defaults/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -gnu_tools_shell_config_file: "" -gnu_tools_brew_packages: - - coreutils # GNU File, Shell, and Text utilities - - gnu-getopt # Command-line option parsing utility - - grep # GNU grep, egrep and fgrep diff --git a/roles/gnu_tools/tasks/main.yml b/roles/gnu_tools/tasks/main.yml deleted file mode 100644 index 631a20f..0000000 --- a/roles/gnu_tools/tasks/main.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- name: Install gnu tools - ansible.builtin.package: - name: "{{ item }}" - state: latest - loop: "{{ gnu_tools_brew_packages }}" - -- name: Manage configuration file (set PATH var) - when: gnu_tools_shell_config_file != "" - block: - - name: Check config files exists - ansible.builtin.stat: - path: "{{ gnu_tools_shell_config_file }}" - register: file_details - - - name: Ensure config files exists - when: not file_details.stat.exists - ansible.builtin.file: - path: "{{ gnu_tools_shell_config_file }}" - state: touch - mode: 0600 - - - name: Create config file to add gnu tools to PATH - ansible.builtin.blockinfile: - marker: "# {mark} - GNU-TOOLS - ANSIBLE MANAGED BLOCK" - insertafter: EOF - path: "{{ gnu_tools_shell_config_file }}" - block: | - export PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:${PATH}" - export PATH="$(brew --prefix)/opt/grep/libexec/gnubin:${PATH}" - export PATH="$(brew --prefix)/opt/gnu-getopt/bin:${PATH}" diff --git a/roles/gpg/defaults/main.yml b/roles/gpg/defaults/main.yml index 90bd190..01069fa 100644 --- a/roles/gpg/defaults/main.yml +++ b/roles/gpg/defaults/main.yml @@ -1,5 +1,4 @@ --- -gpg_brew_package: gnupg -gpg_linux_package: gnupg -gpg_config_dir: "{{ lookup('env', 'HOME') }}/.config/gpg" -gpg_shell_config_file: "" +gpg_brew_packages: + - gnupg + - pinentry-mac diff --git a/roles/zsh/files/.zprofile b/roles/gpg/files/config/.gitkeep similarity index 100% rename from roles/zsh/files/.zprofile rename to roles/gpg/files/config/.gitkeep diff --git a/roles/gpg/files/shell_config/gpg.zsh b/roles/gpg/files/shell_config/gpg.zsh new file mode 100644 index 0000000..cd3e2f9 --- /dev/null +++ b/roles/gpg/files/shell_config/gpg.zsh @@ -0,0 +1,7 @@ +if command -v gpg &>/dev/null; then + if [[ "${SHELL}" =~ 'zsh' ]]; then + export GPG_TTY=${TTY} + else + export GPG_TTY=$(tty) + fi +fi diff --git a/roles/gpg/tasks/main.yml b/roles/gpg/tasks/main.yml index e96fd57..63fd43b 100644 --- a/roles/gpg/tasks/main.yml +++ b/roles/gpg/tasks/main.yml @@ -1,100 +1,67 @@ --- -- name: Select macos package - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - gpg_package: "{{ gpg_brew_package }}" - -- name: Select linux package - when: ansible_system == "Linux" - ansible.builtin.set_fact: - gpg_package: "{{ gpg_linux_package }}" - -- name: Install gpg +- name: Install brew packages ansible.builtin.package: - name: "{{ gpg_package }}" + name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" + loop: "{{ gpg_brew_packages }}" -- name: Ansible check gpg directory exists - ansible.builtin.stat: - path: "{{ gpg_config_dir }}" - register: directory_details +# This ensure that the directory exists as `ansible.builtin.template` does not create it +- name: Copy custom configuration to {{ xdg_config_home }} + ansible.builtin.copy: + src: "./files/config/" # trailing / is important to copy only directory content and not the directory itself + dest: "{{ xdg_config_home }}/gpg" + mode: "0600" -- name: Ensure gpg directory exists - when: not (directory_details.stat.exists and directory_details.stat.isdir) - ansible.builtin.file: - path: "{{ gpg_config_dir }}" - state: directory - mode: 0700 +- name: Copy custom gitconfig to {{ xdg_config_home }} + ansible.builtin.template: + src: "gpg-agent.conf.j2" + dest: "{{ xdg_config_home }}/gpg/gpg-agent.conf" + mode: "0600" - name: Create a symbolic link to custom .gnupg ansible.builtin.file: - src: "{{ gpg_config_dir }}" + src: "{{ xdg_config_home }}/gpg" dest: "~/.gnupg" state: link -- name: Copy Custom gpg configuration to {{ gpg_config_dir }} - ansible.builtin.copy: - src: "./files/" # trailing / is important to copy only files within the directory - dest: "{{ gpg_config_dir }}" - mode: 0600 - -- name: Manage configuration file - when: gpg_shell_config_file != "" - block: - - name: Check config files exists - ansible.builtin.stat: - path: "{{ gpg_shell_config_file }}" - register: file_details - - - name: Ensure config files exists - when: not file_details.stat.exists - ansible.builtin.file: - path: "{{ gpg_shell_config_file }}" - state: touch - mode: 0600 - - - name: Create config file - ansible.builtin.blockinfile: - marker: "# {mark} - GPG - ANSIBLE MANAGED BLOCK" - insertafter: EOF - path: "{{ gpg_shell_config_file }}" - block: | - # Aliases - - # Configure gpg - if command -v gpg &>/dev/null; then - if [[ "${SHELL}" =~ 'zsh' ]]; then - export GPG_TTY=${TTY} - else - export GPG_TTY=$(tty) - fi - fi +- name: Create shell config file in {{ shell_config_dir }} + ansible.builtin.blockinfile: + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" + insertbefore: BOF # Beginning of file + path: "{{ shell_config_dir }}/gpg.zsh" + block: "{{ lookup('ansible.builtin.file', './shell_config/gpg.zsh') }}" + mode: "0600" -- ansible.builtin.debug: - msg: | - Useful gpg commands: - - Generate a key: - gpg --full-generate-key - - List secret keys: - gpg --list-secret-keys --keyid-format=long - - List public keys: - gpg --list-keys --keyid-format=long - - Export public key: - gpg --armor --export --output ./public_pgp.key - - Export private key: - # /!\ This command is normally not necessary. - # /!\ Be careful with the output file, securely delete it using "shred -zu ./private_pgp.key" - gpg --armor --export-secret-keys --output ./private_pgp.key - - Import private or public key: - gpg --import some_pgp.key - - Sign an imported public key (tells gpg that you trust the person the key claims to be) - gpg --default-key --sign-key - - Test Signature - echo "test" | gpg --default-key --clear-sign | gpg --verify - - Test encryption/decryption - echo "test" | gpg --encrypt --recipient "" | gpg --decrypt - - Encrypt file with a person public key, optionally sign using your private key to certify the message is from you - gpg --armor [--default-key "" --sign] --encrypt --recipient --output ./file.txt.gpg ./file.txt - - Decrypt file: - gpg --decrypt --output ./file.txt ./file.txt.gpg +- name: Set checkbox "Save to Keychain" to disabled by default in pinentry-mac + community.general.osx_defaults: + domain: org.gpgtools.pinentry-mac + key: UseKeychain + type: bool + value: false + state: present +# Useful gpg commands: +# - Generate a key: +# gpg --full-generate-key +# - List secret keys: +# gpg --list-secret-keys --keyid-format=long +# - List public keys: +# gpg --list-keys --keyid-format=long +# - Export public key: +# gpg --armor --export --output ./public_pgp.key +# - Export private key: +# # /!\ This command is normally not necessary. +# # /!\ Be careful with the output file, securely delete it using "shred -zu ./private_pgp.key" +# gpg --armor --export-secret-keys --output ./private_pgp.key +# - Import private or public key: +# gpg --import some_pgp.key +# - Sign an imported public key (tells gpg that you trust the person the key claims to be) +# gpg --default-key --sign-key +# - Test Signature +# echo "test" | gpg --default-key --clear-sign | gpg --verify +# - Test encryption/decryption +# echo "test" | gpg --encrypt --recipient "" | gpg --decrypt +# - Encrypt file with a person public key, optionally sign using your private key to certify the message is from you +# gpg --armor [--default-key "" --sign] --encrypt --recipient --output ./file.txt.gpg ./file.txt +# - Decrypt file: +# gpg --decrypt --output ./file.txt ./file.txt.gpg diff --git a/roles/gpg/files/gpg-agent.conf b/roles/gpg/templates/gpg-agent.conf.j2 similarity index 59% rename from roles/gpg/files/gpg-agent.conf rename to roles/gpg/templates/gpg-agent.conf.j2 index ad30014..3b10beb 100644 --- a/roles/gpg/files/gpg-agent.conf +++ b/roles/gpg/templates/gpg-agent.conf.j2 @@ -1,5 +1,8 @@ # https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html#Agent-Options -# Cache passphrase +# Cache passphrase default-cache-ttl 21600 # Default to 6h max-cache-ttl 43200 # Maximum to 12h + +# Configuration passphrase GPG Key +pinentry-program {{ homebrew_prefix }}/bin/pinentry-mac diff --git a/roles/iterm2/defaults/main.yml b/roles/iterm2/defaults/main.yml index d7cd389..3ad832a 100644 --- a/roles/iterm2/defaults/main.yml +++ b/roles/iterm2/defaults/main.yml @@ -1,4 +1,10 @@ --- -iterm2_brew_package: iterm2 -iterm2_domain: "com.googlecode.{{ iterm2_brew_package | lower }}" -iterm2_defaults: [] +iterm2_brew_cask_package: iterm2 + +iterm2_defaults: + - name: OnlyWhenMoreTabs + type: string + value: true + - name: PromptOnQuit + type: bool + value: false diff --git a/roles/iterm2/tasks/main.yml b/roles/iterm2/tasks/main.yml index d37800c..8cc66eb 100644 --- a/roles/iterm2/tasks/main.yml +++ b/roles/iterm2/tasks/main.yml @@ -1,13 +1,12 @@ --- -- name: "Ensure that package is installed: {{ iterm2_brew_package }}" +- name: Intall brew package community.general.homebrew_cask: - name: "{{ iterm2_brew_package | lower }}" + name: "{{ iterm2_brew_cask_package }}" state: latest - when: iterm2_brew_package|length > 0 -- name: Attempting to apply configurations for {{ iterm2_brew_package }} +- name: Apply MacOs configurations community.general.osx_defaults: - domain: "{{ iterm2_domain }}" + domain: com.googlecode.iterm2 key: "{{ item.name }}" state: "{{ item.state | default('present') }}" type: "{{ item.type }}" diff --git a/roles/javascript/defaults/main.yml b/roles/javascript/defaults/main.yml index 9daaa0f..d5d3a57 100644 --- a/roles/javascript/defaults/main.yml +++ b/roles/javascript/defaults/main.yml @@ -1,7 +1,3 @@ --- javascript_brew_packages: - - nvm # Manage multiple Node.js versions -javascript_linux_packages: [] -javascript_shell_config_file: "" - -javascript_nvm_config_dir: "{{ lookup('env', 'HOME') }}/.config/nvm" + - nvm # Manage multiple Node.js versions diff --git a/roles/javascript/files/shell_config/nvm.zsh b/roles/javascript/files/shell_config/nvm.zsh new file mode 100644 index 0000000..a552f1e --- /dev/null +++ b/roles/javascript/files/shell_config/nvm.zsh @@ -0,0 +1,5 @@ +export NVM_DIR="$(brew --prefix)/opt/nvm" +# Load nvm +[ -s "$(brew --prefix)/opt/nvm/nvm.sh" ] && source "$(brew --prefix)/opt/nvm/nvm.sh" +# Load nvm bash_completion +[ -s "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" ] && source "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" diff --git a/roles/javascript/tasks/linux_install.yml b/roles/javascript/tasks/linux_install.yml deleted file mode 100644 index 6f5fd51..0000000 --- a/roles/javascript/tasks/linux_install.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- ansible.builtin.debug: - msg: "Not yet supported" diff --git a/roles/javascript/tasks/main.yml b/roles/javascript/tasks/main.yml index 292d3d3..f84aadb 100644 --- a/roles/javascript/tasks/main.yml +++ b/roles/javascript/tasks/main.yml @@ -1,67 +1,15 @@ --- -- name: Select macos packages - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - javascript_packages: "{{ javascript_brew_packages }}" - -- name: Select linux packages - when: ansible_system == "Linux" - ansible.builtin.set_fact: - javascript_packages: "{{ javascript_linux_packages }}" - -- name: Install javascript tools +- name: Install brew packages ansible.builtin.package: name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" - loop: "{{ javascript_packages }}" - -- name: Install javascript tools on linux (no package manager) - when: - - ansible_system == "Linux" - - not javascript_linux_packages - ansible.builtin.import_tasks: ./linux_install.yml - - -- name: Create nvm config directory - ansible.builtin.file: - path: "{{ javascript_nvm_config_dir }}" - state: directory - recurse: true - -- name: Manage configuration file - when: javascript_shell_config_file != "" - block: - - name: Check config files exists - ansible.builtin.stat: - path: "{{ javascript_shell_config_file }}" - register: file_details - - - name: Ensure config files exists - when: not file_details.stat.exists - ansible.builtin.file: - path: "{{ javascript_shell_config_file }}" - state: touch - mode: 0600 - - - name: Create config file - ansible.builtin.blockinfile: - marker: "# {mark} - javascript - ANSIBLE MANAGED BLOCK" - insertafter: EOF - path: "{{ javascript_shell_config_file }}" - block: | - export NVM_DIR="{{ javascript_nvm_config_dir }}" - # Load nvm - [ -s "/usr/local/opt/nvm/nvm.sh" ] && source "/usr/local/opt/nvm/nvm.sh" - # Load nvm bash_completion - [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && source "/usr/local/opt/nvm/etc/bash_completion.d/nvm" - -- ansible.builtin.debug: - msg: | - Once NVM is installed: - Install the latest Node.js version: - > nvm install node - Use the installed version in any shell: - > nvm use node - Install any dependencies with npm - > npm install --global yarn + loop: "{{ javascript_brew_packages }}" + +- name: Create shell config file in {{ shell_config_dir }} + ansible.builtin.blockinfile: + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" + insertbefore: BOF # Beginning of file + path: "{{ shell_config_dir }}/nvm.zsh" + block: "{{ lookup('ansible.builtin.file', './shell_config/nvm.zsh') }}" + mode: "0600" diff --git a/roles/kubernetes/defaults/main.yml b/roles/kubernetes/defaults/main.yml new file mode 100644 index 0000000..dd9f4dc --- /dev/null +++ b/roles/kubernetes/defaults/main.yml @@ -0,0 +1,15 @@ +--- +k8s_brew_packages: + - kubectl # Kubernetes command-line interface + - helm # Kubernetes package manager + - k9s # Console graphical resource manager: https://github.com/derailed/k9s + - kubectx # Tool that can switch between kubectl contexts easily and create aliases + - kubespy # Tools for observing Kubernetes resources in real time: https://github.com/pulumi/kubespy + - stern # Tail multiple pods on Kubernetes and multiple containers within the pod: https://github.com/wercker/stern + +k8s_kuctl_krew_packages: + - deprecations + - flame + - neat + - oidc-login + - oomd diff --git a/roles/kubernetes/defaults/main/linux.yml b/roles/kubernetes/defaults/main/linux.yml deleted file mode 100644 index d246f47..0000000 --- a/roles/kubernetes/defaults/main/linux.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -kubectl_linux_stable_version_url: https://storage.googleapis.com/kubernetes-release/release/stable.txt -kubectl_linux_binary_url: https://storage.googleapis.com/kubernetes-release/release/{{ kubectl_stable_version }}/bin/linux/amd64/kubectl - -kubectx_linux_binary_url: https://raw.githubusercontent.com/ahmetb/kubectx/master/kubectx -kubens_linux_binary_url: https://raw.githubusercontent.com/ahmetb/kubectx/master/kubens - -helm_linux_installer_url: https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 - -k9s_linux_installer_url: https://github.com/derailed/k9s/releases/latest - -stern_linux_installer_url: https://github.com/wercker/stern/releases/latest diff --git a/roles/kubernetes/defaults/main/main.yml b/roles/kubernetes/defaults/main/main.yml deleted file mode 100644 index 2366303..0000000 --- a/roles/kubernetes/defaults/main/main.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -k8s_brew_packages: - - dive # A tool for exploring each layer in a docker image: https://github.com/wagoodman/dive - - kubectl # Kubernetes command-line interface - - kubectx # Tool that can switch between kubectl contexts easily and create aliases - - kubespy # Tools for observing Kubernetes resources in real time: https://github.com/pulumi/kubespy - - derailed/k9s/k9s # Console graphical resource manager: https://github.com/derailed/k9s - - helm # Kubernetes package manager - - stern # Tail multiple pods on Kubernetes and multiple containers within the pod: https://github.com/wercker/stern - - aquasecurity/trivy/trivy # Simple image security scanner: https://github.com/aquasecurity/trivy -k8s_linux_packages: [] -k8s_shell_config_file: "" -k8s_kubectl_krew_enabled: true -k8s_kube_config_dir: "{{ lookup('env', 'HOME') }}/.config/kube" -k8s_krew_config_dir: "{{ lookup('env', 'HOME') }}/.config/krew" diff --git a/roles/kubernetes/files/config/k9s/skin.yml b/roles/kubernetes/files/config/k9s/skin.yml new file mode 100644 index 0000000..8f643c2 --- /dev/null +++ b/roles/kubernetes/files/config/k9s/skin.yml @@ -0,0 +1,109 @@ +# https://raw.githubusercontent.com/derailed/k9s/master/skins/dracula.yml +foreground: &foreground "#f8f8f2" +background: &background "#282a36" +current_line: ¤t_line "#44475a" +selection: &selection "#44475a" +comment: &comment "#6272a4" +cyan: &cyan "#8be9fd" +green: &green "#50fa7b" +orange: &orange "#ffb86c" +pink: &pink "#ff79c6" +purple: &purple "#bd93f9" +red: &red "#ff5555" +yellow: &yellow "#f1fa8c" + +# Skin... +k9s: + # General K9s styles + body: + fgColor: *foreground + bgColor: *background + logoColor: *purple + # Command prompt styles + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *purple + # ClusterInfoView styles. + info: + fgColor: *pink + sectionColor: *foreground + # Dialog styles. + dialog: + fgColor: *foreground + bgColor: *background + buttonFgColor: *foreground + buttonBgColor: *purple + buttonFocusFgColor: *yellow + buttonFocusBgColor: *pink + labelFgColor: *orange + fieldFgColor: *foreground + frame: + # Borders styles. + border: + fgColor: *selection + focusColor: *current_line + menu: + fgColor: *foreground + keyColor: *pink + # Used for favorite namespaces + numKeyColor: *pink + # CrumbView attributes for history navigation. + crumbs: + fgColor: *foreground + bgColor: *current_line + activeColor: *current_line + # Resource status and update styles + status: + newColor: *cyan + modifyColor: *purple + addColor: *green + errorColor: *red + highlightColor: *orange + killColor: *comment + completedColor: *comment + # Border title styles. + title: + fgColor: *foreground + bgColor: *current_line + highlightColor: *orange + counterColor: *purple + filterColor: *pink + views: + # Charts skins... + charts: + bgColor: default + defaultDialColors: + - *purple + - *red + defaultChartColors: + - *purple + - *red + # TableView attributes. + table: + fgColor: *foreground + bgColor: *background + # Header row styles. + header: + fgColor: *foreground + bgColor: *background + sorterColor: *cyan + # Xray view attributes. + xray: + fgColor: *foreground + bgColor: *background + cursorColor: *current_line + graphicColor: *purple + showIcons: false + # YAML info styles. + yaml: + keyColor: *pink + colonColor: *purple + valueColor: *foreground + # Logs styles. + logs: + fgColor: *foreground + bgColor: *background + indicator: + fgColor: *foreground + bgColor: *purple diff --git a/roles/kubernetes/files/config/kube/.gitkeep b/roles/kubernetes/files/config/kube/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/roles/kubernetes/files/shell_config/kubernetes.zsh b/roles/kubernetes/files/shell_config/kubernetes.zsh new file mode 100644 index 0000000..6699f20 --- /dev/null +++ b/roles/kubernetes/files/shell_config/kubernetes.zsh @@ -0,0 +1,8 @@ +# Aliases +alias k="kubectl" +alias kx="kubectx" +alias kn="kubens" + +# kubectl plugin manager +export KREW_ROOT="${XDG_CONFIG_HOME}/krew" +export PATH="${KREW_ROOT}/bin:$PATH" diff --git a/roles/kubernetes/tasks/krew_install.yml b/roles/kubernetes/tasks/krew_install.yml index 93e5836..0156034 100644 --- a/roles/kubernetes/tasks/krew_install.yml +++ b/roles/kubernetes/tasks/krew_install.yml @@ -1,15 +1,14 @@ ---- # See https://krew.sigs.k8s.io/docs/user-guide/setup/install/ - name: Create krew config directory ansible.builtin.file: - path: "{{ k8s_krew_config_dir }}" + path: "${XDG_CONFIG_HOME}/krew" state: directory recurse: true - name: Install krew (kubectl plugin manager) ansible.builtin.shell: | set -o pipefail - export KREW_ROOT="{{ k8s_krew_config_dir }}" + export KREW_ROOT="${XDG_CONFIG_HOME}/krew" ( set -x; cd "$(mktemp -d)" && OS="$(uname | tr '[:upper:]' '[:lower:]')" && @@ -21,3 +20,22 @@ ) args: executable: /bin/bash + +- name: Update krew plugin manager + ansible.builtin.shell: | + set -o pipefail + export KREW_ROOT="${XDG_CONFIG_HOME}/krew" + export PATH="${KREW_ROOT}/bin:$PATH" + kubectl krew update + args: + executable: /bin/bash + +- name: Install krew plugins + ansible.builtin.shell: | + set -o pipefail + export KREW_ROOT="${XDG_CONFIG_HOME}/krew" + export PATH="${KREW_ROOT}/bin:$PATH" + kubectl krew install {{ item }} + args: + executable: /bin/bash + loop: "{{ k8s_kuctl_krew_packages }}" diff --git a/roles/kubernetes/tasks/linux_install.yml b/roles/kubernetes/tasks/linux_install.yml deleted file mode 100644 index dc4d33e..0000000 --- a/roles/kubernetes/tasks/linux_install.yml +++ /dev/null @@ -1,103 +0,0 @@ ---- -- name: Install kubectl - block: - - name: Download kubectl stable version info - ansible.builtin.get_url: - url: "{{ kubectl_linux_stable_version_url }}" - dest: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/kubernetes-release-stable.txt" - mode: 0640 - changed_when: false - - - name: Register kubectl stable version info - ansible.builtin.set_fact: - kubectl_stable_version: "{{ lookup('file', lookup('config', 'DEFAULT_LOCAL_TMP') + '/kubernetes-release-stable.txt') }}" - changed_when: false - - - name: Download kubectl stable version binary - ansible.builtin.get_url: - url: "{{ kubectl_linux_binary_url }}" - dest: "/usr/local/bin/kubectl" - mode: 0755 - changed_when: false - -- name: Download kubectx latest version binary - ansible.builtin.get_url: - url: "{{ kubectx_linux_binary_url }}" - dest: "/usr/local/bin/kubectx" - mode: 0755 - changed_when: false - -- name: Download kubens latest version binary - ansible.builtin.get_url: - url: "{{ kubens_linux_binary_url }}" - dest: "/usr/local/bin/kubens" - mode: 0755 - changed_when: false - -- name: Install helm - block: - - name: Download helm install script - ansible.builtin.get_url: - url: "{{ helm_linux_installer_url }}" - dest: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/get_helm.sh.sh" - mode: 0700 - changed_when: false - - - name: Run helm install script - ansible.builtin.command: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/get_helm.sh.sh" - -- name: Install k9s - block: - - name: Retrieve k9s latest artifact - ansible.builtin.shell: | - set -o pipefail - curl -sL {{ k9s_linux_installer_url }} | grep -Eo "k9s_Linux_amd64.tar.gz" | uniq - args: - warn: false - register: k9s_release_artifact - changed_when: false - - - ansible.builtin.debug: - var: k9s_release_artifact - - - name: Download k9s release artifact - ansible.builtin.get_url: - url: "{{ k9s_linux_installer_url }}/download/{{ k9s_release_artifact.stdout }}" - dest: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/{{ k9s_release_artifact.stdout }}" - mode: 0700 - changed_when: false - - - name: Create temporary directory to extract k9s - ansible.builtin.file: - path: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/k9s" - state: directory - mode: 0700 - - - name: Unarchive a file that needs to be downloaded (added in 2.0) - ansible.builtin.unarchive: - src: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/{{ k9s_release_artifact.stdout }}" - dest: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/k9s" - - - name: Copy k9s binary to /usr/local/bin - ansible.builtin.copy: - src: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/k9s/k9s" - dest: /usr/local/bin/k9s - mode: 0755 - -- name: Install stern - block: - - name: Retrieve stern latest artifact - ansible.builtin.shell: | - set -o pipefail - curl -sL {{ stern_linux_installer_url }} | grep -Eo "stern_linux_amd64" | uniq - args: - warn: false - register: stern_release_artifact - changed_when: false - - - name: Download stern stable version binary - ansible.builtin.get_url: - url: "{{ stern_linux_installer_url }}/download/{{ stern_release_artifact.stdout }}" - dest: "/usr/local/bin/stern" - mode: 0755 - changed_when: false diff --git a/roles/kubernetes/tasks/main.yml b/roles/kubernetes/tasks/main.yml index 4d0a35b..86bfbef 100644 --- a/roles/kubernetes/tasks/main.yml +++ b/roles/kubernetes/tasks/main.yml @@ -1,104 +1,31 @@ --- -- name: Select macos package - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - k8s_packages: "{{ k8s_brew_packages }}" - -- name: Select linux package - when: ansible_system == "Linux" - ansible.builtin.set_fact: - k8s_packages: "{{ k8s_linux_packages }}" - -- name: Install k8s tools +- name: Install brew packages ansible.builtin.package: name: "{{ item }}" state: latest become: "{{ ansible_system == 'Linux' }}" - loop: "{{ k8s_packages }}" - -- name: Install k8s tools on linux (no package manager) - when: - - ansible_system == "Linux" - ansible.builtin.import_tasks: ./linux_install.yml + loop: "{{ k8s_brew_packages }}" - name: Install kubectl plugin manager - when: - - k8s_kubectl_krew_enabled | bool ansible.builtin.import_tasks: ./krew_install.yml -- name: Move kube config to custom config directory - block: - - name: Ansible check kube config directory exists - ansible.builtin.stat: - path: "{{ k8s_kube_config_dir }}" - register: directory_details - - - name: Ensure kube config directory exists - when: not (directory_details.stat.exists and directory_details.stat.isdir) - ansible.builtin.file: - path: "{{ k8s_kube_config_dir }}" - state: directory - mode: 0700 - - - name: Create a symbolic link to custom .kube - ansible.builtin.file: - src: "{{ k8s_kube_config_dir }}" - dest: "~/.kube" - state: link - -- name: Manage configuration file - when: k8s_shell_config_file != "" - block: - - name: Check config files exists - ansible.builtin.stat: - path: "{{ k8s_shell_config_file }}" - register: file_details - - - name: Ensure config files exists - when: not file_details.stat.exists - ansible.builtin.file: - path: "{{ k8s_shell_config_file }}" - state: touch - mode: 0600 - - - name: Create config file - ansible.builtin.blockinfile: - marker: "# {mark} - K8S - ANSIBLE MANAGED BLOCK" - insertafter: EOF - path: "{{ k8s_shell_config_file }}" - block: | - # Aliases - alias k="kubectl" - alias kx="kubectx" - alias kn="kubens" - - {% if k8s_kubectl_krew_enabled | bool -%} - # kubectl plugin manager - export KREW_ROOT="{{ k8s_krew_config_dir }}" - export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" - {% endif %} - - # Completion for kubectl - if [[ "${SHELL}" =~ 'zsh' ]]; then - source <(kubectl completion zsh) - elif [[ "${SHELL}" =~ 'bash' ]]; then - source <(kubectl completion bash) - fi - # Add completion for the 'k' alias - complete -F __start_kubectl k - - # Completion for helm - if [[ "${SHELL}" =~ 'zsh' ]]; then - source <(helm completion zsh) - elif [[ "${SHELL}" =~ 'bash' ]]; then - source <(helm completion bash) - fi - - # Completion for stern - if [[ -x "$(command -v stern)" ]]; then - if [[ "${SHELL}" =~ 'zsh' ]]; then - source <(stern --completion=zsh) - elif [[ "${SHELL}" =~ 'bash' ]]; then - source <(stern --completion=bash) - fi - fi +- name: Copy custom configuration to {{ xdg_config_home }} + ansible.builtin.copy: + src: "./files/config/" # trailing / is important to copy only directory content and not the directory itself + dest: "{{ xdg_config_home }}" + mode: "0600" + +- name: Create a symbolic link to custom .kube + ansible.builtin.file: + src: "{{ xdg_config_home }}/kube" + dest: "~/.kube" + state: link + +- name: Create shell config file in {{ shell_config_dir }} + ansible.builtin.blockinfile: + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" + insertbefore: BOF # Beginning of file + path: "{{ shell_config_dir }}/kubernetes.zsh" + block: "{{ lookup('ansible.builtin.file', './shell_config/kubernetes.zsh') }}" + mode: "0600" diff --git a/roles/nvim/defaults/main.yml b/roles/nvim/defaults/main.yml new file mode 100644 index 0000000..4a44e0b --- /dev/null +++ b/roles/nvim/defaults/main.yml @@ -0,0 +1,3 @@ +--- +nvim_brew_packages: + - nvim diff --git a/roles/nvim/files/config/init.vim b/roles/nvim/files/config/init.vim new file mode 100644 index 0000000..e69de29 diff --git a/roles/nvim/files/shell_config/nvim.zsh b/roles/nvim/files/shell_config/nvim.zsh new file mode 100644 index 0000000..e5cc12d --- /dev/null +++ b/roles/nvim/files/shell_config/nvim.zsh @@ -0,0 +1 @@ +alias vim='nvim' diff --git a/roles/nvim/tasks/main.yml b/roles/nvim/tasks/main.yml new file mode 100644 index 0000000..af4dd76 --- /dev/null +++ b/roles/nvim/tasks/main.yml @@ -0,0 +1,21 @@ +--- +- name: Install nvim + ansible.builtin.package: + name: "{{ item }}" + state: latest + loop: "{{ nvim_brew_packages }}" + +- name: Copy custom configuration to {{ xdg_config_home }} + ansible.builtin.copy: + src: "./files/config/" # trailing / is important to copy only directory content and not the directory itself + dest: "{{ xdg_config_home }}/nvim" + mode: "0600" + +- name: Create shell config file in {{ shell_config_dir }} + ansible.builtin.blockinfile: + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" + insertbefore: BOF # Beginning of file + path: "{{ shell_config_dir }}/nvim.zsh" + block: "{{ lookup('ansible.builtin.file', './shell_config/nvim.zsh') }}" + mode: "0600" diff --git a/roles/python/defaults/main.yml b/roles/python/defaults/main.yml index 0bad153..2001503 100644 --- a/roles/python/defaults/main.yml +++ b/roles/python/defaults/main.yml @@ -1,5 +1,4 @@ --- python_brew_packages: - python -python_linux_packages: - - python3 + - poetry diff --git a/roles/python/tasks/main.yml b/roles/python/tasks/main.yml index 52791ff..ff1582c 100644 --- a/roles/python/tasks/main.yml +++ b/roles/python/tasks/main.yml @@ -1,17 +1,6 @@ --- -- name: Select macos package - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - python_packages: "{{ python_brew_packages }}" - -- name: Select linux package - when: ansible_system == "Linux" - ansible.builtin.set_fact: - python_packages: "{{ python_linux_packages }}" - -- name: Install python +- name: Install brew packages ansible.builtin.package: name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" - loop: "{{ python_packages }}" + loop: "{{ python_brew_packages }}" diff --git a/roles/screen/defaults/main.yml b/roles/screen/defaults/main.yml deleted file mode 100644 index f33d6f6..0000000 --- a/roles/screen/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -screen_brew_package: screen -screen_linux_package: screen -screen_config_dir: "{{ lookup('env', 'HOME') }}/.config/screen" diff --git a/roles/screen/tasks/main.yml b/roles/screen/tasks/main.yml deleted file mode 100644 index f40187b..0000000 --- a/roles/screen/tasks/main.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- name: Select macos package - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - screen_package: "{{ screen_brew_package }}" - -- name: Select linux package - when: ansible_system == "Linux" - ansible.builtin.set_fact: - screen_package: "{{ screen_linux_package }}" - -- name: Install screen - ansible.builtin.package: - name: "{{ screen_package }}" - state: latest - become: "{{ ansible_system == 'Linux' }}" - -- name: Copy Custom zsh configuration to {{ screen_config_dir }} - ansible.builtin.copy: - src: "./files/" # trailing / is important to copy only files within the directory - dest: "{{ screen_config_dir }}" - mode: 0644 - -- name: Create a symbolic link to custom screenrc - ansible.builtin.file: - src: "{{ screen_config_dir }}/.screenrc" - dest: "~/.screenrc" - state: link diff --git a/roles/ssh/defaults/main.yml b/roles/ssh/defaults/main.yml index 27a8f5e..ed97d53 100644 --- a/roles/ssh/defaults/main.yml +++ b/roles/ssh/defaults/main.yml @@ -1,2 +1 @@ --- -ssh_config_dir: "{{ lookup('env', 'HOME') }}/.ssh" diff --git a/roles/ssh/tasks/main.yml b/roles/ssh/tasks/main.yml index d92e290..66fdcb9 100644 --- a/roles/ssh/tasks/main.yml +++ b/roles/ssh/tasks/main.yml @@ -1,44 +1,11 @@ --- - -- name: Ansible check ssh directory exists - ansible.builtin.stat: - path: "{{ ssh_config_dir }}" - register: directory_details - -- name: Ensure ssh directory exists - when: not (directory_details.stat.exists and directory_details.stat.isdir) - ansible.builtin.file: - path: "{{ ssh_config_dir }}" - state: directory - mode: 0700 - -- name: Check config files exists - ansible.builtin.stat: - path: "{{ ssh_config_dir }}/config" - register: file_details - -- name: Ensure config files exists - when: not file_details.stat.exists - ansible.builtin.file: - path: "{{ ssh_config_dir }}/config" - state: touch - mode: 0600 - - name: Add default SSH config ansible.builtin.blockinfile: - marker: "# {mark} - SSH - ANSIBLE MANAGED BLOCK" + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" insertafter: EOF - path: "{{ ssh_config_dir }}/config" + path: "{{ ansible_env.HOME }}/.ssh/config" block: | - # # Add a github account using another ssh key - # # Ex: git clone git@github-personal-account:bsemp/workstation-bootstrap.git - # Host github-personal-account - # HostName github.com - # User git - # PreferredAuthentications publickey - # IdentityFile ~/.ssh/github_personal_account - # IdentitiesOnly yes - # Add default github config Host github.com User git @@ -50,3 +17,4 @@ UseKeychain yes ForwardAgent no Compression yes + mode: "0600" diff --git a/roles/terraform/defaults/main.yml b/roles/terraform/defaults/main.yml index 355b956..cca7ca5 100644 --- a/roles/terraform/defaults/main.yml +++ b/roles/terraform/defaults/main.yml @@ -1,7 +1,3 @@ --- terraform_brew_packages: - - warrensbox/tap/tfswitch # The tfswitch command lets you switch between terraform versions. -terraform_linux_packages: [] -terraform_shell_config_file: "" - -tfswitch_linux_installer_url: https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh + - warrensbox/tap/tfswitch # The tfswitch command lets you switch between terraform versions. diff --git a/roles/terraform/files/shell_config/terraform.zsh b/roles/terraform/files/shell_config/terraform.zsh new file mode 100644 index 0000000..93ee349 --- /dev/null +++ b/roles/terraform/files/shell_config/terraform.zsh @@ -0,0 +1,9 @@ +# Aliases +alias tf="terraform" +alias tfc="terraform console" +alias tfi="terraform import" +alias tfl="terraform fmt" +alias tfs="terraform state" +alias tft="terraform taint" +alias tfut="terraform untaint" +alias tfw="terraform workspace" diff --git a/roles/terraform/tasks/linux_install.yml b/roles/terraform/tasks/linux_install.yml deleted file mode 100644 index fba6be2..0000000 --- a/roles/terraform/tasks/linux_install.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Install tfswitch - block: - - name: Download tfswitch install script - ansible.builtin.get_url: - url: "{{ tfswitch_linux_installer_url }}" - dest: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/tfswitch_install.sh" - mode: 0700 - changed_when: false - - - name: Run tfswitch install script - ansible.builtin.command: "{{ lookup('config', 'DEFAULT_LOCAL_TMP') }}/tfswitch_install.sh" - become: true diff --git a/roles/terraform/tasks/main.yml b/roles/terraform/tasks/main.yml index fbbb32e..97c51fa 100644 --- a/roles/terraform/tasks/main.yml +++ b/roles/terraform/tasks/main.yml @@ -1,54 +1,15 @@ --- -- name: Select macos packages - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - terraform_packages: "{{ terraform_brew_packages }}" - -- name: Select linux packages - when: ansible_system == "Linux" - ansible.builtin.set_fact: - terraform_packages: "{{ terraform_linux_packages }}" - -- name: Install terraform tools +- name: Install brew packages ansible.builtin.package: name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" - loop: "{{ terraform_packages }}" - -- name: Install terraform tools on linux (no package manager) - when: - - ansible_system == "Linux" - - not terraform_linux_packages - ansible.builtin.import_tasks: ./linux_install.yml - -- name: Manage configuration file - when: terraform_shell_config_file != "" - block: - - name: Check config files exists - ansible.builtin.stat: - path: "{{ terraform_shell_config_file }}" - register: file_details - - - name: Ensure config files exists - when: not file_details.stat.exists - ansible.builtin.file: - path: "{{ terraform_shell_config_file }}" - state: touch - mode: 0600 - - - name: Create config file - ansible.builtin.blockinfile: - marker: "# {mark} - TERRAFORM - ANSIBLE MANAGED BLOCK" - insertafter: EOF - path: "{{ terraform_shell_config_file }}" - block: | - # Aliases - alias tf="terraform" - alias tfc="terraform console" - alias tfi="terraform import" - alias tfl="terraform fmt" - alias tfs="terraform state" - alias tft="terraform taint" - alias tfut="terraform untaint" - alias tfw="terraform workspace" + loop: "{{ terraform_brew_packages }}" + +- name: Create shell config file in {{ shell_config_dir }} + ansible.builtin.blockinfile: + create: true + marker: "# {mark} - ANSIBLE MANAGED BLOCK" + insertbefore: BOF # Beginning of file + path: "{{ shell_config_dir }}/terraform.zsh" + block: "{{ lookup('ansible.builtin.file', './shell_config/terraform.zsh') }}" + mode: "0600" diff --git a/roles/vim/defaults/main.yml b/roles/vim/defaults/main.yml index 7ee86ad..7281fcb 100644 --- a/roles/vim/defaults/main.yml +++ b/roles/vim/defaults/main.yml @@ -1,4 +1,3 @@ --- -vim_brew_package: vim -vim_linux_package: vim -vim_config_dir: "{{ lookup('env', 'HOME') }}/.config/vim" +vim_brew_packages: + - vim diff --git a/roles/vim/files/.vimrc b/roles/vim/files/config/.vimrc similarity index 100% rename from roles/vim/files/.vimrc rename to roles/vim/files/config/.vimrc diff --git a/roles/vim/tasks/main.yml b/roles/vim/tasks/main.yml index 3d102e6..1886a85 100644 --- a/roles/vim/tasks/main.yml +++ b/roles/vim/tasks/main.yml @@ -1,29 +1,18 @@ --- -- name: Select macos package - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - vim_package: "{{ vim_brew_package }}" - -- name: Select linux package - when: ansible_system == "Linux" - ansible.builtin.set_fact: - vim_package: "{{ vim_linux_package }}" - -- name: Install vim +- name: Install brew packages ansible.builtin.package: - name: "{{ vim_package }}" + name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" + loop: "{{ vim_brew_packages }}" -- name: Copy Custom vim configuration to {{ vim_config_dir }} +- name: Copy custom configuration to {{ xdg_config_home }} ansible.builtin.copy: - src: "./files/" # trailing / is important to copy only files within the directory - dest: "{{ vim_config_dir }}" - mode: 0644 + src: "./files/config/" # trailing / is important to copy only directory content and not the directory itself + dest: "{{ xdg_config_home }}/vim" + mode: "0600" - name: Create a symbolic link to custom .vimrc ansible.builtin.file: - src: "{{ vim_config_dir }}/.vimrc" + src: "{{ xdg_config_home }}/vim/.vimrc" dest: "~/.vimrc" state: link - mode: 0644 diff --git a/roles/zsh/defaults/main.yml b/roles/zsh/defaults/main.yml index 0736e62..c526ec8 100644 --- a/roles/zsh/defaults/main.yml +++ b/roles/zsh/defaults/main.yml @@ -1,4 +1,6 @@ --- -zsh_brew_package: zsh -zsh_linux_package: zsh -zsh_config_dir: "{{ lookup('env', 'HOME') }}/.config/zsh" +zsh_brew_packages: + - git + - zsh + - antidote +zsh_config_dir: "{{ xdg_config_home }}/zsh" diff --git a/roles/zsh/files/.antigenrc b/roles/zsh/files/.antigenrc deleted file mode 100644 index ef7de8c..0000000 --- a/roles/zsh/files/.antigenrc +++ /dev/null @@ -1,61 +0,0 @@ -# Load the oh-my-zsh's library. -antigen use oh-my-zsh - -# Bundles from the default repo (robbyrussell's oh-my-zsh). -antigen bundle command-not-found -antigen bundle colorize -antigen bundle colored-man-pages - -# OS specific plugins -if [[ $(uname) == 'Darwin' ]]; then - antigen bundle macos -fi - -# Automatic archive extract command 'extract or x' -antigen bundle extract - -# Git Plugins -antigen bundle git -antigen bundle git-prompt - -# Python Plugins -antigen bundle pip -antigen bundle python -antigen bundle virtualenv -antigen bundle pyenv -antigen bundle darvid/zsh-poetry - -# Node Plugins -antigen bundle node -antigen bundle nvm -antigen bundle npm - -# Docker -antigen bundle docker -antigen bundle docker-compose - -# Syntax highlighting bundle. -antigen bundle zsh-users/zsh-syntax-highlighting - -# Adjust suggestions color according to terminal theme -ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=10" -antigen bundle zsh-users/zsh-autosuggestions - -antigen bundle zsh-users/zsh-completions -antigen bundle zsh-users/zsh-history-substring-search - -# Load the theme. -antigen theme romkatv/powerlevel10k - -# Auto update antigen -antigen bundle unixorn/autoupdate-antigen.zshplugin - -# Autoenv -AUTOENV_FILE_ENTER='.autoenv_enter' -AUTOENV_FILE_LEAVE='.autoenv_leave' -AUTOENV_LOOK_UPWARDS=1 -AUTOENV_HANDLE_LEAVE=1 -antigen bundle Tarrasch/zsh-autoenv - -# Tell Antigen that you're done. -antigen apply diff --git a/roles/zsh/files/.p10k.zsh b/roles/zsh/files/.p10k.zsh deleted file mode 100644 index d9923eb..0000000 --- a/roles/zsh/files/.p10k.zsh +++ /dev/null @@ -1,1063 +0,0 @@ -# Generated by Powerlevel10k configuration wizard on 2020-01-14 at 16:47 CET. -# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 52061. -# Wizard options: nerdfont-complete + powerline, large icons, rainbow, -# angled separators, sharp heads, flat tails, 2 lines, solid, no frame, darkest, sparse, -# many icons, concise, transient_prompt. -# Type `p10k configure` to generate another config. -# -# Config for Powerlevel10k with powerline prompt style with colorful background. -# Type `p10k configure` to generate your own config based on it. -# -# Tip: Looking for a nice color? Here's a one-liner to print colormap. -# -# for i in {0..255}; do print -Pn "%${i}F${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done - -# Temporarily change options. -'builtin' 'local' '-a' 'p10k_config_opts' -[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') -[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') -[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') -'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' - -() { - emulate -L zsh - setopt no_unset extended_glob - - # Unset all configuration options. This allows you to apply configiguration changes without - # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m 'POWERLEVEL9K_*' - - autoload -Uz is-at-least && is-at-least 5.1 || return - - zmodload zsh/langinfo - if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then - local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8} - fi - - # The list of segments shown on the left. Fill it with the most important segments. - typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( - # =========================[ Line #1 ]========================= - os_icon # os identifier - dir # current directory - vcs # git status - # =========================[ Line #2 ]========================= - newline - prompt_char # prompt symbol - ) - - # The list of segments shown on the right. Fill it with less important segments. - # Right prompt on the last prompt line (where you are typing your commands) gets - # automatically hidden when the input line reaches it. Right prompt above the - # last prompt line gets hidden if it would overlap with left prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( - # =========================[ Line #1 ]========================= - status # exit code of the last command - command_execution_time # duration of the last command - background_jobs # presence of background jobs - direnv # direnv status (https://direnv.net/) - virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) - # anaconda # conda environment (https://conda.io/) - pyenv # python environment (https://github.com/pyenv/pyenv) - goenv # go environment (https://github.com/syndbg/goenv) - nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) - nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) - nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) - # node_version # node.js version - # go_version # go version (https://golang.org) - # rust_version # rustc version (https://www.rust-lang.org) - # dotnet_version # .NET version (https://dotnet.microsoft.com) - # rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) - # rvm # ruby version from rvm (https://rvm.io) - # fvm # flutter version management (https://github.com/leoafarias/fvm) - # luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) - jenv # java version from jenv (https://github.com/jenv/jenv) - # plenv # perl version from plenv (https://github.com/tokuhirom/plenv) - kubecontext # current kubernetes context (https://kubernetes.io/) - terraform # terraform workspace (https://www.terraform.io) - aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) - # aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) - azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - # gcloud # google cloud cli acccount and project (https://cloud.google.com/) - # google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) - context # user@hostname - # nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) - # ranger # ranger shell (https://github.com/ranger/ranger) - # nnn # nnn shell (https://github.com/jarun/nnn) - vim_shell # vim shell indicator (:sh) - # midnight_commander # midnight commander shell (https://midnight-commander.org/) - # vi_mode # vi mode (you don't need this if you've enabled prompt_char) - # vpn_ip # virtual private network indicator - # ram # free RAM - # load # CPU load - # todo # todo items (https://github.com/todotxt/todo.txt-cli) - # time # current time - # =========================[ Line #2 ]========================= - newline - # public_ip # public IP address - # proxy # system-wide http/https/ftp proxy - # battery # internal battery - # example # example user-defined segment (see prompt_example function below) - ) - - # To disable default icons for all segments, set POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION=''. - # - # To enable default icons for all segments, don't define POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION - # or set it to '${P9K_VISUAL_IDENTIFIER}'. - # - # To remove trailing space from all default icons, set POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION - # to '${P9K_VISUAL_IDENTIFIER% }'. - # - # To enable default icons for one segment (e.g., dir), set - # POWERLEVEL9K_DIR_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'. - # - # To assign a specific icon to one segment (e.g., dir), set - # POWERLEVEL9K_DIR_VISUAL_IDENTIFIER_EXPANSION='⭐'. - # - # To assign a specific icon to a segment in a given state (e.g., dir in state NOT_WRITABLE), - # set POWERLEVEL9K_DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐'. - # - # Note: You can use $'\u2B50' instead of '⭐'. It's especially convenient when specifying - # icons that your text editor cannot render. Don't forget to put $ and use single quotes when - # defining icons via Unicode codepoints. - # - # Note: Many default icons cannot be displayed with system fonts. You'll need to install a - # capable font to use them. See POWERLEVEL9K_MODE below. - typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}' - - # This option makes a difference only when default icons are enabled for all or some prompt - # segments (see POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION above). LOCK_ICON can be printed as - # $'\uE0A2', $'\uE138' or $'\uF023' depending on POWERLEVEL9K_MODE. The correct value of this - # parameter depends on the provider of the font your terminal is using. - # - # Font Provider | POWERLEVEL9K_MODE - # ---------------------------------+------------------- - # Powerline | powerline - # Font Awesome | awesome-fontconfig - # Adobe Source Code Pro | awesome-fontconfig - # Source Code Pro | awesome-fontconfig - # Awesome-Terminal Fonts (regular) | awesome-fontconfig - # Awesome-Terminal Fonts (patched) | awesome-patched - # Nerd Fonts | nerdfont-complete - # Other | compatible - # - # If this looks overwhelming, either stick with a preinstalled system font and set - # POWERLEVEL9K_MODE=compatible, or install the recommended Powerlevel10k font from - # https://github.com/romkatv/powerlevel10k/#recommended-meslo-nerd-font-patched-for-powerlevel10k - # and set POWERLEVEL9K_MODE=nerdfont-complete. - typeset -g POWERLEVEL9K_MODE=nerdfont-complete - - # When set to true, icons appear before content on both sides of the prompt. When set - # to false, icons go after content. If empty or not set, icons go before content in the left - # prompt and after content in the right prompt. - # - # You can also override it for a specific segment: - # - # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false - # - # Or for a specific segment in specific state: - # - # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false - typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= - - # Add an empty line before each prompt. - typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true - - # Connect left prompt lines with these symbols. You'll probably want to use the same color - # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= - # Connect right prompt lines with these symbols. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= - - # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or - # '─'. The last two make it easier to see the alignment between left and right prompt and to - # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - # for more compact prompt if using using this option. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='─' - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= - if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then - # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE - # ornaments defined above. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=238 - # Start filler from the edge of the screen if there are no left segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' - # End filler on the edge of the screen if there are no right segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' - fi - - # Separator between same-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' - # Separator between same-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' - # Separator between different-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' - # Separator between different-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' - # The right end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' - # The left end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' - # The left end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='' - # The right end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='' - # Left prompt terminator for lines without any segments. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= - - #################################[ os_icon: os identifier ]################################## - # OS identifier color. - typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 - typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 - # Make the icon bold. - typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='%B${P9K_CONTENT}' - - ################################[ prompt_char: prompt symbol ]################################ - # Transparent background. - typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= - # Green prompt symbol if the last command succeeded. - typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 - # Red prompt symbol if the last command failed. - typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 - # Default prompt symbol. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' - # Prompt symbol in command vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' - # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ' - # Prompt symbol in overwrite vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' - typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true - # No line terminator if prompt_char is the last segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= - # No line introducer if prompt_char is the first segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= - # No surrounding whitespace. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= - - ##################################[ dir: current directory ]################################## - # Current directory background color. - # typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 - # Default current directory foreground color. - typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 - # If directory is too long, shorten some of its segments to the shortest possible unique - # prefix. The shortened directory can be tab-completed to the original. - typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique - # Replace removed segment suffixes with this symbol. - typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= - # Color of the shortened directory segments. - typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 - # Color of the anchor directory segments. Anchor segments are never shortened. The first - # segment is always an anchor. - typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255 - # Display anchor directory segments in bold. - typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true - # Don't shorten directories that contain any of these files. They are anchors. - local anchor_files=( - .bzr - .citc - .git - .hg - .node-version - .python-version - .ruby-version - .shorten_folder_marker - .svn - .terraform - CVS - Cargo.toml - composer.json - go.mod - package.json - ) - typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" - # Don't shorten this many last directory segments. They are anchors. - typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 - # Shorten directory if it's longer than this even if there is space for it. The value can - # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, - # directory will be shortened only when prompt doesn't fit or when other parameters demand it - # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). - # If set to `0`, directory will always be shortened to its minimum length. - typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this - # many columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least - # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 - # If set to true, embed a hyperlink into the directory. Useful for quickly - # opening a directory in the file manager simply by clicking the link. - # Can also be handy when the directory is shortened, as it allows you to see - # the full directory that was used in previous commands. - typeset -g POWERLEVEL9K_DIR_HYPERLINK=false - - # Enable special styling for non-writable directories. - typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=true - # Show this icon when the current directory is not writable. POWERLEVEL9K_DIR_SHOW_WRITABLE - # above must be set to true for this parameter to have effect. - # typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Custom prefix. - # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' - - # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons for different directories. - # It must be an array with 3 * N elements. Each triplet consists of: - # - # 1. A pattern against which the current directory is matched. Matching is done with - # extended_glob option enabled. - # 2. Directory class for the purpose of styling. - # 3. Icon. - # - # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. If there - # are no matches, the directory will have no icon. - # - # Example: - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=( - # '~/work(|/*)' WORK '(╯°□°)╯︵ ┻━┻' - # '~(|/*)' HOME '⌂' - # '*' DEFAULT '') - # - # With these settings, the current directory in the prompt may look like this: - # - # (╯°□°)╯︵ ┻━┻ ~/work/projects/important/urgent - # - # Or like this: - # - # ⌂ ~/best/powerlevel10k - # - # You can also set different colors for directories of different classes. Remember to override - # FOREGROUND, SHORTENED_FOREGROUND and ANCHOR_FOREGROUND for every directory class that you wish - # to have its own color. - # - # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=() - - #####################################[ vcs: git status ]###################################### - # Version control system colors. - # typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 - # typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 - # typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 - # typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 - # typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 - - # Disable branch name truncating - typeset -g POWERLEVEL9K_VCS_SHORTEN_STRATEGY=None - - # Display short commit number - typeset -g POWERLEVEL9K_SHOW_CHANGESET=true - - # Custom icon. - # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_VCS_PREFIX='on ' - - # Show status of repositories of these types. You can add svn and/or hg if you are - # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg reposotiry. - typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) - - ##########################[ status: exit code of the last command ]########################### - # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and - # style them independently from the regular OK and ERROR state. - typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true - - # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as - # it will signify success by turning green. - typeset -g POWERLEVEL9K_STATUS_OK=false - typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' - # typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 - # typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 - - # Status when some part of a pipe command fails but the overall exit status is zero. It may look - # like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' - # typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 - # typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 - - # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as - # it will signify error by turning red. - typeset -g POWERLEVEL9K_STATUS_ERROR=false - typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' - # typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 - # typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 - - # Status when the last command was terminated by a signal. - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true - # Use terse signal names: "INT" instead of "SIGINT(2)". - typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' - # typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 - # typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 - - # Status when some part of a pipe command fails and the overall exit status is also non-zero. - # It may look like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' - # typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 - # typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 - - ###################[ command_execution_time: duration of the last command ]################### - # Execution time color. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 - # Show duration of the last command if takes longer than this many seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 - # Show this many fractional digits. Zero means round to seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 - # Duration format: 1d 2h 3m 4s. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' - # Custom icon. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' - - #######################[ background_jobs: presence of background jobs ]####################### - # Background jobs color. - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 - # Don't show the number of background jobs. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false - # Icon to show when there are background jobs. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}' - - #######################[ direnv: direnv status (https://direnv.net/) ]######################## - # Direnv color. - # typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 - # typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 - # Icon to show when direnv is active. - typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}' - - ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### - # NordVPN connection indicator color. - # typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 - # typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 - # Hide NordVPN connection indicator when not connected. - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= - # Custom icon. - # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## - # Ranger shell color. - # typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 - # typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### - # Nnn shell color. - # typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 - # typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### - # Vim shell indicator color. - # typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 - # typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 - # Icon to show when in a vim shell. - typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}' - - ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### - # Midnight Commander shell color. - # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 - # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 - # Icon to show when in a midnight commander shell. - typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}' - - ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### - # Foreground color. - typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 - # Text and color for normal (a.k.a. command) vi mode. - typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL - typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 - # Text and color for visual vi mode. - typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL - typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 - # Text and color for overtype (a.k.a. overwrite and replace) vi mode. - typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE - typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 - # Text and color for insert vi mode. - typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= - typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 - - ######################################[ ram: free RAM ]####################################### - # RAM color. - # typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 - # typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################################[ load: CPU load ]###################################### - # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. - typeset -g POWERLEVEL9K_LOAD_WHICH=5 - # Load color when load is under 50%. - # typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 - # typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 - # Load color when load is between 50% and 70%. - # typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 - # typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 - # Load color when load is over 70%. - # typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 - # typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 - # Custom icon. - # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ - # Todo color. - # typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 - # typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 - # Hide todo when the total number of tasks is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true - # Hide todo when the number of tasks after filtering is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false - - # Todo format. The following parameters are available within the expansion. - # - # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. - # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. - # - # These variables correspond to the last line of the output of `todo.sh -p ls`: - # - # TODO: 24 of 42 tasks shown - # - # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. - # - # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################################[ context: user@hostname ]################################## - # Context color when running with privileges. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 - typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 - # Context color in SSH without privileges. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 - # Default context color (no privileges, no SSH). - typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 - typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 - - # Context format when running with privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' - # Context format when in SSH without privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' - # Default context format (no privileges, no SSH): user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' - - # Don't show context unless running with privileges or in SSH. - # Tip: Remove the next line to always show context. - typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' - - ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### - # Python virtual environment color. - # typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 - # Don't show Python version next to the virtual environment name. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=true - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################[ anaconda: conda environment (https://conda.io/) ]###################### - # Anaconda environment color. - # typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 - # typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 - # Don't show Python version next to the anaconda environment name. - typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ - # Pyenv color. - # typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 - # Hide python version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) - # If set to false, hide python version if it's the same as global: - # $(pyenv version-name) == $(pyenv global). - typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false - # Custom icon. - # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ - # Goenv color. - # typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 - # Don't show the current Go version if it's the same as global. - typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false - # Custom icon. - # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## - # Nodenv color. - # typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 - # typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 - # Don't show node version if it's the same as global: $(nodenv version-name) == $(nodenv global). - typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false - # Custom icon. - # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### - # Nvm color. - # typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 - # Custom icon. - # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ - # Nodeenv color. - # typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 - # typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 - # Don't show Node version next to the environment name. - typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false - # Separate environment name from Node version only with a space. - typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############################[ node_version: node.js version ]############################### - # Node version color. - # typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 - # typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 - # Show node version only when in a directory tree containing package.json. - typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ go_version: go version (https://golang.org) ]######################## - # Go version color. - # typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 - # typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 - # Show go version only when in a go project subdirectory. - typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## - # Rust version color. - # typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 - # typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 - # Show rust version only when in a rust project subdirectory. - typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ - # .NET version color. - # typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 - # typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 - # Show .NET version only when in a .NET project subdirectory. - typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## - # Rbenv color. - # typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 - # Hide ruby version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) - # If set to false, hide ruby version if it's the same as global: - # $(rbenv version-name) == $(rbenv global). - typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false - # Custom icon. - # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## - # Rvm color. - # typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 - # typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 - # Don't show @gemset at the end. - typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false - # Don't show ruby- at the front. - typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ - # Fvm color. - # typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 - # typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### - # Lua color. - # typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 - # Hide lua version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) - # If set to false, hide lua version if it's the same as global: - # $(luaenv version-name) == $(luaenv global). - typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false - # Custom icon. - # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ - # Java color. - # typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 - # typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 - # Hide java version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) - # If set to false, hide java version if it's the same as global: - # $(jenv version-name) == $(jenv global). - typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false - # Custom icon. - # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ - # Perl color. - # typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 - # Hide perl version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) - # If set to false, hide perl version if it's the same as global: - # $(plenv version-name) == $(plenv global). - typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false - # Custom icon. - # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Terraform color. - # typeset -g POWERLEVEL9K_TERRAFORM_FOREGROUND=4 - # typeset -g POWERLEVEL9K_TERRAFORM_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # AWS profile color. - # typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 - # typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current AWS profile gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the context class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current AWS profile is "company_test", its class is TEST - # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# - # AWS Elastic Beanstalk environment color. - # typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 - # typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Azure account name color. - # typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7 - # typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ gcloud: google cloud acccount and project (https://cloud.google.com/) ]########### - # Google cloud color. - # typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 - # typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 - - # Google cloud format. Uncomment POWERLEVEL9K_GCLOUD_CONTENT_EXPANSION and edit its value if the - # default is too verbose. - # - # P9K_GCLOUD_ACCOUNT: the output of `gcloud config get-value account` - # P9K_GCLOUD_PROJECT: the output of `gcloud config get-value project` - # ${VARIABLE//\%/%%}: ${VARIABLE} with all occurences of '%' replaced with '%%'. - # - # typeset -g POWERLEVEL9K_GCLOUD_CONTENT_EXPANSION='${P9K_GCLOUD_ACCOUNT//\%/%%}:${P9K_GCLOUD_PROJECT//\%/%%}' - - # Custom icon. - # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Google application credentials classes for the purpose of using different colors, icons and - # expansions with different credentials. - # - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first - # element in each pair defines a pattern against which the current kubernetes context gets - # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion - # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION - # parameters, you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. - # The first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD - # '*:*test*:*' TEST - # '*' DEFAULT) - # - # If your current Google application credentials is "service_account deathray-testing x@y.com", - # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD # These values are examples that are unlikely - # '*:*test*:*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by - # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # You can use the following parameters in the expansion. Each of them corresponds to one of the - # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. - # - # Parameter | JSON key file field - # ---------------------------------+--------------- - # P9K_GOOGLE_APP_CRED_TYPE | type - # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id - # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' - - #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Kubernetes context classes for the purpose of using different colors, icons and expansions with - # different contexts. - # - # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current kubernetes context gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current kubernetes context is "deathray-testing/default", its class is TEST - # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 - # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext - # segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # Within the expansion the following parameters are always available: - # - # - P9K_CONTENT The content that would've been displayed if there was no content - # expansion defined. - # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE - # in the output of `kubectl config get-contexts`. If there is no - # namespace, the parameter is set to "default". - # - # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), - # the following extra parameters are available: - # - # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. - # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. - # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. - # - # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, - # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=gke - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - # - # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=eks - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= - # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' - # Append the current context's namespace if it's not "default". - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' - - # Custom prefix. - # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' - - ###############################[ public_ip: public IP address ]############################### - # Public IP color. - # typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 - # typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ########################[ vpn_ip: virtual private network indicator ]######################### - # VPN IP color. - # typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 - # typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 - # When on VPN, show just an icon without the IP address. - typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run ifconfig while on VPN to see the - # name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*' - # Icon to show when on VPN. - typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}' - - #########################[ proxy: system-wide http/https/ftp proxy ]########################## - # Proxy color. - # typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 - # typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################################[ battery: internal battery ]################################# - # Show battery in red when it's below this level and not connected to power supply. - typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 - typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 - # Show battery in green when it's charging or fully charged. - typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 - # Show battery in yellow when it's discharging. - typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 - # Battery pictograms going from low to high level of charge. - typeset -g POWERLEVEL9K_BATTERY_STAGES=$'\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' - # Don't show the remaining time to charge/discharge. - typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false - # typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 - - ####################################[ time: current time ]#################################### - # Current time color. - # typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 - # typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 - # Format for the current time: 09:51:02. See `man 3 strftime`. - typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' - # If set to true, time will update when you hit enter. This way prompts for the past - # commands will contain the start times of their commands as opposed to the default - # behavior where they contain the end times of their preceding commands. - typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false - # Custom icon. - # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_TIME_PREFIX='at ' - - # Example of a user-defined prompt segment. Function prompt_example will be called on every - # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or - # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background - # greeting the user. - # - # Type `p10k help segment` for documentation and a more sophisticated example. - function prompt_example() { - p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n' - } - - # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job - # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function - # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k - # will replay these calls without actually calling instant_prompt_*. It is imperative that - # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this - # rule is not observed, the content of instant prompt will be incorrect. - # - # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If - # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. - function instant_prompt_example() { - # Since prompt_example always makes the same `p10k segment` calls, we can call it from - # instant_prompt_example. This will give us the same `example` prompt segment in the instant - # and regular prompts. - prompt_example - } - - # User-defined prompt segments can be customized the same way as built-in segments. - # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 - # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt - # when accepting a command line. Supported values: - # - # - off: Don't change prompt when accepting a command line. - # - always: Trim down prompt when accepting a command line. - # - same-dir: Trim down prompt when accepting a command line unless this is the first command - # typed after changing current working directory. - typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=same-dir - - # Instant prompt mode. - # - # - off: Disable instant prompt. Choose this if you've tried instant prompt and found - # it incompatible with your zsh configuration files. - # - quiet: Enable instant prompt and don't print warnings when detecting console output - # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - verbose: Enable instant prompt and print a warning when detecting console output during - # zsh initialization. Choose this if you've never tried instant prompt, haven't - # seen the warning, or if you are unsure what this all means. - typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose - - # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. - # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload - # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you - # really need it. - typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true - - # If p10k is already loaded, reload configuration. - # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. - (( ! $+functions[p10k] )) || p10k reload -} - -(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} -'builtin' 'unset' 'p10k_config_opts' diff --git a/roles/zsh/files/.zshrc b/roles/zsh/files/.zshrc deleted file mode 100644 index 7e53d55..0000000 --- a/roles/zsh/files/.zshrc +++ /dev/null @@ -1,68 +0,0 @@ -# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. -# Initialization code that may require console input (password prompts, [y/n] -# confirmations, etc.) must go above this block, everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -fi - -# Define the default shell and editor -if type brew &>/dev/null; then - export SHELL="$(brew --prefix)/bin/zsh" - export EDITOR="$(brew --prefix)/bin/vim" -else - export SHELL="/bin/zsh" - export EDITOR="/usr/bin/vim" -fi - -# Define the default language -export LANG="en_US.UTF-8" - -# make Homebrew’s completions available in zsh -if type brew &>/dev/null; then - fpath+="$(brew --prefix)/share/zsh/site-functions" -fi - -# Custom completion file directory (must be set before `compinit`) -# Completion files must start with "_" (ex "_poetry") -fpath+="${ZDOTDIR}/completions" - -# The following lines were added by compinstall -zstyle ':completion:*' completer _complete _ignored -zstyle ':completion:*' format 'Completing %d' -zstyle ':completion:*' group-name '' -zstyle ':completion:*' insert-unambiguous true -zstyle ':completion:*' list-colors '' -zstyle :compinstall filename "${ZDOTDIR}/.zshrc" - -autoload -Uz compinit -compinit -# End of lines added by compinstall - -# Enable bash completion functions in ZSH -autoload -Uz bashcompinit -bashcompinit - -# Download Antigen plugin in custom zsh configuration directory -if [[ ! -s ${ZDOTDIR}/antigen.zsh ]]; then - curl --silent -L git.io/antigen > "${ZDOTDIR}/antigen.zsh" -fi - -# Load Antigen -ANTIGEN_CACHE=false # FIX Completion: https://github.com/zsh-users/antigen/issues/603#issuecomment-776286903 -source ${ZDOTDIR}/antigen.zsh - -# Load antigen configuration -source ${ZDOTDIR}/.antigenrc 2&> /dev/null - -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -source ${ZDOTDIR}/.p10k.zsh - -# Functions -for FUNCTIONS in ${ZDOTDIR}/functions/*.zsh; do - source "${FUNCTIONS}" -done - -# Other -for OTHERS in ${ZDOTDIR}/custom/*.zsh; do - source "${OTHERS}" -done diff --git a/roles/zsh/files/config/.zlogin b/roles/zsh/files/config/.zlogin new file mode 100644 index 0000000..e69de29 diff --git a/roles/zsh/files/config/.zlogout b/roles/zsh/files/config/.zlogout new file mode 100644 index 0000000..e69de29 diff --git a/roles/zsh/files/config/.zprofile b/roles/zsh/files/config/.zprofile new file mode 100644 index 0000000..e69de29 diff --git a/roles/zsh/files/config/.zsh_plugins.txt b/roles/zsh/files/config/.zsh_plugins.txt new file mode 100644 index 0000000..7dc3b87 --- /dev/null +++ b/roles/zsh/files/config/.zsh_plugins.txt @@ -0,0 +1,33 @@ +# Install zsh-users plugins +zsh-users/zsh-autosuggestions kind:defer +zsh-users/zsh-completions +zsh-users/zsh-history-substring-search kind:defer +zsh-users/zsh-syntax-highlighting + +# Install oh-my-zsh plugins (https://github.com/ohmyzsh/ohmyzsh/tree/master) +ohmyzsh/ohmyzsh path:lib +ohmyzsh/ohmyzsh path:plugins/azure +ohmyzsh/ohmyzsh path:plugins/colored-man-pages +ohmyzsh/ohmyzsh path:plugins/colorize +ohmyzsh/ohmyzsh path:plugins/command-not-found +ohmyzsh/ohmyzsh path:plugins/docker +ohmyzsh/ohmyzsh path:plugins/extract +ohmyzsh/ohmyzsh path:plugins/gh +ohmyzsh/ohmyzsh path:plugins/git +ohmyzsh/ohmyzsh path:plugins/git-prompt +ohmyzsh/ohmyzsh path:plugins/helm +ohmyzsh/ohmyzsh path:plugins/kubectl +ohmyzsh/ohmyzsh path:plugins/macos +ohmyzsh/ohmyzsh path:plugins/node +ohmyzsh/ohmyzsh path:plugins/npm +ohmyzsh/ohmyzsh path:plugins/pip +ohmyzsh/ohmyzsh path:plugins/poetry +ohmyzsh/ohmyzsh path:plugins/pyenv +ohmyzsh/ohmyzsh path:plugins/python +ohmyzsh/ohmyzsh path:plugins/virtualenv + +# Automatically activates virtual environments created by Poetry +darvid/zsh-poetry + +# Automatically sources (known/whitelisted) .autoenv files +Tarrasch/zsh-autoenv diff --git a/roles/zsh/files/config/.zshpluginsrc b/roles/zsh/files/config/.zshpluginsrc new file mode 100644 index 0000000..034420d --- /dev/null +++ b/roles/zsh/files/config/.zshpluginsrc @@ -0,0 +1,17 @@ +# Configuration for ZSH plugins installed with Antidote + +# A number of oh-my-zsh plugins (including cache-path in the completions.zsh file) use $ZSH_CACHE_DIR to store their data. +# The variable is set in oh-my-zsh.sh by default, but not on antidote +ZSH_CACHE_DIR=${XDG_CACHE_HOME}/oh-my-zsh +if [[ ! -d $ZSH_CACHE_DIR ]]; then + mkdir -p $ZSH_CACHE_DIR/{completions,} +fi + +# Adjust suggestions color according to terminal theme +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=10" + +# Autoenv +AUTOENV_FILE_ENTER='.autoenv_enter' +AUTOENV_FILE_LEAVE='.autoenv_leave' +AUTOENV_LOOK_UPWARDS=1 +AUTOENV_HANDLE_LEAVE=1 diff --git a/roles/zsh/files/README.md b/roles/zsh/files/config/README.md similarity index 88% rename from roles/zsh/files/README.md rename to roles/zsh/files/config/README.md index 17c9c2a..27148d9 100644 --- a/roles/zsh/files/README.md +++ b/roles/zsh/files/config/README.md @@ -4,10 +4,9 @@ By default, all config files are located in `${HOME}`. -To keep home directory clean all simplify configuration and backup, the variable `ZDOTDIR` is overriden in `.zshenv` to point to `${HOME}/.config/zsh` and all config files are created in this repository. -Similarly `ADOTDIR` (antigen) is overriden to point to `${ZDOTDIR}/antigen` +To keep home directory clean all simplify configuration and backup, the variable `ZDOTDIR` is overriden in `.zshenv` to point to `${XDG_CONFIG_HOME}/zsh` and all config files are created in this repository. -In order for *ZSH* to be able to use this new location (without modifying system wide config in /etc/profile), a symlink should be created from `${HOME}/.zshenv` to `${HOME}/.config/zsh/.zshenv` +In order for *ZSH* to be able to use this new location (without modifying system wide config in /etc/profile), a symlink should be created from `${HOME}/.zshenv` to `${XDG_CONFIG_HOME}/zsh/.zshenv` ## Config files edition diff --git a/roles/zsh/files/completions/.gitkeep b/roles/zsh/files/config/completions/.gitkeep similarity index 100% rename from roles/zsh/files/completions/.gitkeep rename to roles/zsh/files/config/completions/.gitkeep diff --git a/roles/zsh/files/config/config/history.zsh b/roles/zsh/files/config/config/history.zsh new file mode 100644 index 0000000..b70a77e --- /dev/null +++ b/roles/zsh/files/config/config/history.zsh @@ -0,0 +1,30 @@ + +# Configure history +export HISTFILE=${ZDOTDIR}/.zsh_history +export HISTSIZE=10000 +export SAVEHIST=${HISTSIZE} +# /!\ Needs "setopt extendedglob" +# "#" means optional. Ex: "vim#( *)#" matches "vi", "vim", "vim .*", "vi .*" +export HISTORY_IGNORE='([bf]g *|l[alsh]#( *)#|history|cd( *)#|z( *)#|git add *|git reset *|pwd|exit|date|*--help|vault*)' + +# https://zsh.sourceforge.io/Doc/Release/Options.html#History +setopt BANG_HIST # Treat the '!' character specially during expansion. +setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. +setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. +setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history. +setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again. +setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate. +setopt HIST_FIND_NO_DUPS # Do not display a previously found event. +setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. +setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. +setopt HIST_VERIFY # Do not execute immediately upon history expansion. +setopt HIST_BEEP # Beep when accessing non-existent history. + +# https://zsh.sourceforge.io/Doc/Release/Functions.html#Hook-Functions +# https://zsh.sourceforge.io/Doc/Release/Parameters.html#Parameters-Used-By-The-Shell +zshaddhistory() { + emulate -L zsh + # HISTORY_IGNORE should use EXTENDED_GLOB syntax + setopt extendedglob + [[ $1 != ${~HISTORY_IGNORE} ]] +} diff --git a/roles/zsh/files/functions/weather.zsh b/roles/zsh/files/config/config/weather.zsh similarity index 100% rename from roles/zsh/files/functions/weather.zsh rename to roles/zsh/files/config/config/weather.zsh diff --git a/roles/zsh/files/custom/history.zsh b/roles/zsh/files/custom/history.zsh deleted file mode 100644 index 90d3b79..0000000 --- a/roles/zsh/files/custom/history.zsh +++ /dev/null @@ -1,22 +0,0 @@ - -# Configure history -export HISTFILE=${ZDOTDIR}/.zsh_history -export HISTSIZE=50000 -export SAVEHIST=${HISTSIZE} -# /!\ Needs "setopt extendedglob" -# "#" means optional. Ex: "vim#( *)#" matches "vi", "vim", "vim .*", "vi .* " -export HISTORY_IGNORE='([bf]g *|l[alsh]#( *)#|history|cd( *)#|z( *)#|git add *|git reset *|pwd|exit|date|*--help|vault*)' - -# https://zsh.sourceforge.io/Doc/Release/Options.html#History -setopt HIST_IGNORE_SPACE -setopt HIST_IGNORE_ALL_DUPS -setopt HIST_NO_STORE - -# https://zsh.sourceforge.io/Doc/Release/Functions.html#Hook-Functions -# https://zsh.sourceforge.io/Doc/Release/Parameters.html#Parameters-Used-By-The-Shell -zshaddhistory() { - emulate -L zsh - # HISTORY_IGNORE should use EXTENDED_GLOB syntax - setopt extendedglob - [[ $1 != ${~HISTORY_IGNORE} ]] -} diff --git a/roles/zsh/files/custom/homebrew.zsh b/roles/zsh/files/custom/homebrew.zsh deleted file mode 100644 index e785ca7..0000000 --- a/roles/zsh/files/custom/homebrew.zsh +++ /dev/null @@ -1,4 +0,0 @@ -# Add homebrew bin, sbin to PATH -if [[ "$(uname)" == 'Darwin' ]]; then - export PATH="$(brew --prefix)/bin:$(brew --prefix)/sbin:${PATH}" -fi diff --git a/roles/zsh/files/custom/system.zsh b/roles/zsh/files/custom/system.zsh deleted file mode 100644 index 82aa7ee..0000000 --- a/roles/zsh/files/custom/system.zsh +++ /dev/null @@ -1,18 +0,0 @@ -# ZSHconfig edition -alias zshenv="${EDITOR:-vim} ${ZDOTDIR}/.zshenv" -alias zshrc="${EDITOR:-vim} ${ZDOTDIR}/.zshrc" -alias zshprofile="${EDITOR:-vim} ${ZDOTDIR}/.zprofile" -alias zshlogin="${EDITOR:-vim} ${ZDOTDIR}/.zlogin" -alias zshlogout="${EDITOR:-vim} ${ZDOTDIR}/.zlogout" -alias antigenconfig="${EDITOR:-vim} ${ZDOTDIR}/.antigenrc" -alias p10kconfig="${EDITOR:-vim} ${ZDOTDIR}/.p10k.zsh" - -# Make XDG_CONFIG explicit -# https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html -export XDG_DATA_HOME="${HOME}/.local/share" -export XDG_CONFIG_HOME="${HOME}/.config" -export XDG_STATE_HOME="${HOME}/.local/state" -export XDG_DATA_DIRS="/usr/local/share/:/usr/share/" -export XDG_CONFIG_DIRS="/etc/xdg" -export XDG_CACHE_HOME="$HOME/.cache" -export XDG_RUNTIME_DIR="" diff --git a/roles/zsh/tasks/main.yml b/roles/zsh/tasks/main.yml index d2c9d21..91a560e 100644 --- a/roles/zsh/tasks/main.yml +++ b/roles/zsh/tasks/main.yml @@ -1,42 +1,36 @@ --- -- name: Select macos package - when: ansible_system == "Darwin" - ansible.builtin.set_fact: - zsh_package: "{{ zsh_brew_package }}" - -- name: Select linux package - when: ansible_system == "Linux" - ansible.builtin.set_fact: - zsh_package: "{{ zsh_linux_package }}" - -- name: Install ZSH +- name: Install brew packages ansible.builtin.package: - name: "{{ zsh_package }}" + name: "{{ item }}" state: latest - become: "{{ ansible_system == 'Linux' }}" + loop: "{{ zsh_brew_packages }}" - name: Copy Custom zsh configuration to {{ zsh_config_dir }} ansible.builtin.copy: - src: "./files/" # trailing / is important to copy only directory content and not the directory itself + src: "./files/config/" # trailing / is important to copy only directory content and not the directory itself dest: "{{ zsh_config_dir }}" - mode: 0644 + mode: "0600" + +- name: Copy Custom zshrc to {{ zsh_config_dir }} + ansible.builtin.template: + src: ".zshrc.j2" + dest: "{{ zsh_config_dir }}/.zshrc" + mode: "0600" - name: Copy Custom zshenv to {{ zsh_config_dir }} ansible.builtin.template: - src: ".zshenv.tpl" + src: ".zshenv.j2" dest: "{{ zsh_config_dir }}/.zshenv" - mode: 0644 + mode: "0600" - name: Create a symbolic link to custom zshenv ansible.builtin.file: src: "{{ zsh_config_dir }}/.zshenv" dest: "~/.zshenv" state: link - mode: 0644 - name: Create a symbolic link to custom zsh completions ansible.builtin.file: src: "{{ zsh_config_dir }}/completions" dest: "~/.zshcompletions" state: link - mode: 0755 diff --git a/roles/zsh/templates/.zshenv.j2 b/roles/zsh/templates/.zshenv.j2 new file mode 100644 index 0000000..ef25f77 --- /dev/null +++ b/roles/zsh/templates/.zshenv.j2 @@ -0,0 +1,19 @@ +# ZSH dot files directory +export ZDOTDIR="{{ zsh_config_dir | replace(home_directory, '${HOME}') }}" + +# Make XDG_CONFIG explicit +# https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html +export XDG_DATA_HOME="{{ xdg_data_home | replace(home_directory, '${HOME}') }}" +export XDG_CONFIG_HOME="{{ xdg_config_home | replace(home_directory, '${HOME}') }}" +export XDG_STATE_HOME="{{ xdg_state_home | replace(home_directory, '${HOME}') }}" +export XDG_DATA_DIRS="{{ xdg_data_dirs | replace(home_directory, '${HOME}') }}" +export XDG_CONFIG_DIRS="{{ xdg_config_dirs | replace(home_directory, '${HOME}') }}" +export XDG_CACHE_HOME="{{ xdg_cache_home | replace(home_directory, '${HOME}') }}" +export XDG_RUNTIME_DIR="{{ xdg_runtime_dir | replace(home_directory, '${HOME}') }}" + +# ZSHconfig edition +alias zshenv="${EDITOR:-vim} ${ZDOTDIR}/.zshenv" +alias zshrc="${EDITOR:-vim} ${ZDOTDIR}/.zshrc" +alias zshprofile="${EDITOR:-vim} ${ZDOTDIR}/.zprofile" +alias zshlogin="${EDITOR:-vim} ${ZDOTDIR}/.zlogin" +alias zshlogout="${EDITOR:-vim} ${ZDOTDIR}/.zlogout" diff --git a/roles/zsh/templates/.zshenv.tpl b/roles/zsh/templates/.zshenv.tpl deleted file mode 100644 index 1bfbe77..0000000 --- a/roles/zsh/templates/.zshenv.tpl +++ /dev/null @@ -1,4 +0,0 @@ -# ZSH dot files directory -export ZDOTDIR="{{ zsh_config_dir }}" -# Antigen (ZSH plugin manager) dot files directory -export ADOTDIR="{{ zsh_config_dir }}/antigen" diff --git a/roles/zsh/templates/.zshrc.j2 b/roles/zsh/templates/.zshrc.j2 new file mode 100644 index 0000000..6886727 --- /dev/null +++ b/roles/zsh/templates/.zshrc.j2 @@ -0,0 +1,62 @@ +# Define the default language +export LANG="en_US.UTF-8" + +# Define the default shell +export SHELL="$(brew --prefix)/bin/zsh" + +# Define the default editor +if command -v nvim &>/dev/null; then + export EDITOR="$(brew --prefix)/bin/nvim" +else + export EDITOR="$(brew --prefix)/bin/vim" +fi + +# make Homebrew’s completions available in zsh +fpath+="$(brew --prefix)/share/zsh/site-functions" + +# Custom completion file directory (must be set before `compinit`) +# Completion files must start with "_" (ex "_poetry") +fpath+="${ZDOTDIR}/completions" + +# The following lines were added by compinstall +zstyle ':completion:*' completer _complete _ignored +zstyle ':completion:*' format 'Completing %d' +zstyle ':completion:*' group-name '' +zstyle ':completion:*' insert-unambiguous true +zstyle ':completion:*' list-colors '' +zstyle :compinstall filename "${ZDOTDIR}/.zshrc" + +autoload -Uz compinit +compinit +# End of lines added by compinstall + +# Enable bash completion functions in ZSH +# Bash completion can be found in "$(brew --prefix)/etc/bash_completion.d" +# WARNING: Do not load all directory content as it can conflict with previously loaded ZSH completions +# from "$(brew --prefix)/share/zsh/site-functions" +# ZSH completions are more powerful so always prefer selecting exactly the required bash completion files +# by sourcing them after `bashcompinit` +autoload -Uz bashcompinit +bashcompinit + +# Enable bash style backward kill (word stop delimiters) +autoload -U select-word-style +select-word-style bash + +# source antidote +source $(brew --prefix)/share/antidote/antidote.zsh +# source antidote plugins config (config needed before plugins loading) +source ${ZDOTDIR:-~}/.zshpluginsrc +# initialize plugins statically with ${ZDOTDIR:-~}/.zsh_plugins.txt +export ANTIDOTE_HOME="${XDG_CACHE_HOME}/antidote" +zstyle ':antidote:bundle' use-friendly-names 'yes' +antidote load +# Antidote can update itself, and all bundles in a single pass using command `antidote update` + +# Extra configurations +for CONFIG_FILE in $(find \ + "${ZDOTDIR}/config" \ + "{{ shell_config_dir | replace(home_directory, '${HOME}') }}" \ + -type f -name "*.zsh" 2>/dev/null | sort -u); do + source "${CONFIG_FILE}" +done