Skip to content

Commit 4ef2419

Browse files
committed
feat: migrate from asdf to mise
1 parent 19cd8b5 commit 4ef2419

File tree

11 files changed

+101
-163
lines changed

11 files changed

+101
-163
lines changed

config/private_dot_config/private_fish/conf.d/asdf.fish

-7
This file was deleted.

docs/features/Installation.md

+17-19
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ The Xcode Command Line Tools includes `git` and `make` (not available on stock
2121
macOS).
2222

2323
!!! warning
24-
If your machine has already homebrew preinstalled, - make sure you have the full
25-
ownership over directories managed by `brew`. See
26-
[this](https://github.com/homebrew/brew/issues/3665) issue for more information.
24+
If your machine has already homebrew preinstalled, - make sure you have the full
25+
ownership over directories managed by `brew`. See
26+
[this](https://github.com/homebrew/brew/issues/3665) issue for more information.
2727

2828
## Running `setup.sh`
2929

@@ -62,25 +62,23 @@ The script will:
6262
[`ansible.sh`](https://github.com/shmileee/dotfiles/blob/master/scripts/common/ansible.sh),
6363
which in turn will:
6464

65-
- Install `community.general` Ansible collection
66-
- Check if passwordless `sudo` is available (if no, - the script will prompt you for
67-
password)
68-
- Execute
69-
[`main.yaml`](https://github.com/shmileee/dotfiles/blob/master/scripts/common/ansible/main.yaml)
70-
playbook
65+
- Install `community.general` Ansible collection
66+
- Check if passwordless `sudo` is available (if no, - the script will prompt you for
67+
password)
68+
- Execute
69+
[`main.yaml`](https://github.com/shmileee/dotfiles/blob/master/scripts/common/ansible/main.yaml)
70+
playbook
7171

7272
## Ansible
7373

74-
7574
The
7675
[following](https://github.com/shmileee/dotfiles/blob/master/scripts/common/ansible/main.yaml)
7776
playbook is the main entrypoint for configuring the actual system and dotfiles.
78-
7977

8078
The
8179
[`config.yaml`](https://github.com/shmileee/dotfiles/blob/master/scripts/common/ansible/config.yaml)
8280
file allows you to personalize the setup to your needs. At most it contains a
83-
list of packages and their versions (in case of tools managed by `asdf`) to
81+
list of packages and their versions (in case of tools managed by `mise`) to
8482
install.
8583

8684
The
@@ -90,12 +88,12 @@ dotfiles to the system. If you tend to reuse this playbook, make sure to adjust
9088
the variable accordingly.
9189

9290
!!! warning
93-
Certain Ansible tasks expect specific dotfiles to be in place, e.g.
94-
[`install tmux
91+
Certain Ansible tasks expect specific dotfiles to be in place, e.g.
92+
[`install tmux
9593
plugins`](https://github.com/shmileee/dotfiles/blob/master/scripts/common/ansible/roles/tmux/tasks/main.yaml#L22-L26)
96-
will fail if
97-
[`tmux.conf`](https://github.com/shmileee/dotfiles/blob/master/config/private_dot_config/private_tmux/tmux.conf#L188)
98-
is missing or does not include `run '~/.tmux/plugins/tpm/tpm'` line.
94+
will fail if
95+
[`tmux.conf`](https://github.com/shmileee/dotfiles/blob/master/config/private_dot_config/private_tmux/tmux.conf#L188)
96+
is missing or does not include `run '~/.tmux/plugins/tpm/tpm'` line.
9997

10098
Supported Ansible roles:
10199

@@ -111,7 +109,7 @@ Supported Ansible roles:
111109
neovim will be compiled. Otherwise, download nightly deb package from
112110
GitHub. On macOS neovim is installed using HEAD revision via brew.
113111
- `lunarvim` - Install LunarVim and reapply chezmoi to populate `config.lua`
114-
- `asdf` - Install asdf version manager for typical packages that need more
112+
- `mise` - Install mise version manager for typical packages that need more
115113
granular control over. All tools and their respective versions are defined in
116114
`config.yaml`.
117115
- `docker` - Install docker using brew.
@@ -201,7 +199,7 @@ Supported Ansible roles:
201199
202200
│ ┌────────────────────┐
203201
│ ┌────┐ │ install plugins │
204-
├─►│asdf├────────►│ install tools │
202+
├─►│mise├────────►│ install tools │
205203
│ └────┘ │ set global versions│
206204
│ └────────────────────┘
207205

docs/features/Tools.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ Here's a non-exhaustive list of everything I used in my personal dotfiles.
2424

2525
- [homebrew](https://brew.sh/) as primary package manager ([casks +
2626
formulas](https://github.com/shmileee/dotfiles/blob/master/scripts/common/ansible/config.yaml#L10)).
27-
- [asdf](https://asdf-vm.com) as version manager for various system tools
28-
([packages](https://github.com/shmileee/dotfiles/blob/master/scripts/common/ansible/config.yaml#L108)).
27+
- [mise](https://blog.oponomarov.com/posts/mise-faster-smarter-tool-versioning) as version manager for various system tools.
2928

3029
**Apps**
3130

scripts/common/ansible/config.yaml

+42-61
Original file line numberDiff line numberDiff line change
@@ -104,67 +104,48 @@ neovim:
104104
- pkg-config
105105
- unzip
106106

107-
asdf_version: "v0.14.0"
108-
asdf_plugins:
109-
- name: "python"
110-
repository: "https://github.com/danhper/asdf-python"
111-
versions:
112-
- 3.10.1
113-
- 3.11.8
114-
delete_versions: []
115-
global: 3.11.8
116-
117-
- name: "golang"
118-
repository: "https://github.com/kennyp/asdf-golang"
119-
versions:
120-
- 1.18
121-
- 1.22.5
122-
delete_versions: []
123-
global: system
124-
125-
- name: "ruby"
126-
repository: "https://github.com/asdf-vm/asdf-ruby"
127-
versions:
128-
- 3.0.3
129-
delete_versions: []
130-
global: system
131-
132-
- name: "nodejs"
133-
repository: "https://github.com/asdf-vm/asdf-nodejs"
134-
versions:
135-
- 17.7.2
136-
- 21.2.0
137-
delete_versions: []
138-
global: system
139-
140-
- name: "terraform"
141-
repository: "https://github.com/asdf-community/asdf-hashicorp"
142-
versions:
143-
- 1.1.7
144-
- 1.9.2
145-
delete_versions: []
146-
global: 1.9.2
147-
148-
- name: "terraform-ls"
149-
repository: "https://github.com/shihanng/asdf-terraform-ls"
150-
versions:
151-
- 0.34.0
152-
delete_versions: []
153-
global: 0.34.0
154-
155-
- name: "kubectl"
156-
repository: "https://github.com/asdf-community/asdf-kubectl"
157-
versions:
158-
- 1.30.2
159-
delete_versions: []
160-
global: 1.30.2
161-
162-
- name: "helm"
163-
repository: "https://github.com/Antiarchitect/asdf-helm"
164-
versions:
165-
- 3.15.3
166-
delete_versions: []
167-
global: 3.15.3
107+
mise_tools:
108+
core:
109+
- name: "python"
110+
versions:
111+
- 3.11.8
112+
113+
- name: "go"
114+
versions:
115+
- 1.23.4
116+
- 1.21.0
117+
118+
- name: "ruby"
119+
versions:
120+
- 3.3.6
121+
122+
- name: "node"
123+
versions:
124+
- 21.2.0
125+
aqua:
126+
- name: "terraform"
127+
versions:
128+
- 1.10.2
129+
130+
- name: "terraform-ls"
131+
versions:
132+
- 0.36.2
133+
134+
- name: "kubectl"
135+
versions:
136+
- 1.32.0
137+
138+
- name: "helm"
139+
versions:
140+
- 3.16.3
141+
142+
- name: "pre-commit"
143+
versions:
144+
- 4.0.1
145+
146+
- name: "terramate"
147+
versions:
148+
- 0.11.4
168149

169150
golang:
170151
path: "{{ ansible_user_dir }}/.go"

scripts/common/ansible/main.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
# - name: lunarvim
2626
# tags: lunarvim
2727

28-
- name: asdf
29-
tags: asdf
28+
- name: mise
29+
tags: mise
3030

3131
- name: go
3232
tags: go

scripts/common/ansible/roles/asdf/tasks/install.yaml

-7
This file was deleted.

scripts/common/ansible/roles/asdf/tasks/main.yaml

-7
This file was deleted.

scripts/common/ansible/roles/asdf/tasks/plugins.yaml

-54
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
- name: "core :: install tools"
3+
ansible.builtin.command: >
4+
mise install {{ item.0.name }}@{{ item.1 }}
5+
args:
6+
creates: ".local/share/mise/installs/{{ item.0.name }}/{{ item.1 }}"
7+
chdir: "{{ ansible_user_dir }}"
8+
with_subelements:
9+
- "{{ mise_tools.core }}"
10+
- versions
11+
when: mise_tools.core | length > 0
12+
13+
- name: "core :: set the newest version as default"
14+
ansible.builtin.command: >
15+
mise use --global {{ item.name }}@{{ item.versions | sort | last }}
16+
loop: "{{ mise_tools.core }}"
17+
when: mise_tools.core | length > 0
18+
19+
- name: "extra :: install tools with `aqua` backend"
20+
ansible.builtin.command: >
21+
mise use --global aqua:{{ item.0.name }}@{{ item.1 }}
22+
args:
23+
creates: ".local/share/mise/installs/aqua-{{ item.0.name }}/{{ item.1 }}"
24+
chdir: "{{ ansible_user_dir }}"
25+
with_subelements:
26+
- "{{ mise_tools.aqua }}"
27+
- versions
28+
when: mise_tools.aqua | length > 0
29+
30+
- name: "extra :: set the newest version as default"
31+
ansible.builtin.command: >
32+
mise use --global {{ item.name }}@{{ item.versions | sort | last }}
33+
loop: "{{ mise_tools.core }}"
34+
when: mise_tools.core | length > 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
- name: "install tools"
3+
import_tasks: "install.yaml"
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
2-
32
- name: "install packages"
43
community.general.npm:
5-
name: '{{ item }}'
4+
name: "{{ item }}"
65
global: true
7-
executable: '{{ ansible_user_dir }}/.asdf/shims/npm'
8-
with_items: '{{ nodejs.packages }}'
6+
with_items: "{{ nodejs.packages }}"
97
when: nodejs.packages

0 commit comments

Comments
 (0)