-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
105 lines (95 loc) · 3.14 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
- name: Basic setup for local machine
hosts: localhost
vars:
packages_to_install:
- apt-file
- autojump
- chrony
- fzf
- git
- htop
- mosh
- powertop
- rsync
- stow
- tmux
- trash-cli
- wget
# zsh
- zsh
# emacs
- autoconf
- imagemagick
- libgccjit-12-dev
- libglib2.0-dev
- libgnutls28-dev
- libgtk2.0-dev
- libmagick++-dev
- libncurses-dev
- libtree-sitter-dev
- libxft-dev
- texinfo
# doom
- fd-find
- ripgrep
git_repos:
- { repo: 'https://github.com/tmux-plugins/tpm.git', dest: '~/.tmux/plugins/tpm' }
- { repo: 'https://github.com/ohmyzsh/ohmyzsh.git', dest: '~/.oh-my-zsh' }
- { repo: 'https://github.com/zsh-users/zsh-autosuggestions.git', dest: '~/.oh-my-zsh/custom/plugins/zsh-autosuggestions' }
- { repo: 'https://github.com/romkatv/powerlevel10k.git', dest: '~/.oh-my-zsh/custom/themes/powerlevel10k' }
- { repo: 'https://git.savannah.gnu.org/git/emacs.git', dest: '~/workspace/applications/emacs' }
- { repo: 'https://github.com/doomemacs/doomemacs.git', dest: '~/.config/emacs' }
stow_items:
- zsh
- tmux
# - doom
# - regolith
tasks:
- name: Install packages
become: yes
ansible.builtin.package:
name: "{{ packages_to_install }}"
state: present
- name: Change default shell to zsh
ansible.builtin.user:
name: "{{ ansible_user_id }}"
shell: /bin/zsh
- name: Clone Git repositories
ansible.builtin.git:
repo: "{{ item.repo }}"
dest: "{{ item.dest }}"
depth: 1
with_items: "{{ git_repos }}"
- name: Debug user directory
become: no
ansible.builtin.debug:
msg: "User directory is {{ ansible_env.HOME }}"
- name: Stow dotfiles
become: no
ansible.builtin.command:
cmd: stow -v -t "{{ ansible_env.HOME }}" -d "{{ ansible_env.HOME }}/dotfiles" "{{ item }}"
with_items: "{{ stow_items }}"
# TODO: build+install emacs from source
# ./configure --with-native-compilation --with-imagemagick --with-json --with-tree-sitter --with-xft --with-modules --with-threads --with-x-toolkit=gtk2 --with-zlib --with-jpeg --with-png
# TODO: add emacs to path
# - name: Install doom
# become: no
# ansible.builtin.command:
# cmd: "{{ ansible_env.HOME }}/.config/emacs/bin/doom install"
- name: Install miniconda
become: no
shell: |
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init zsh
args:
creates: "{{ ansible_env.HOME }}/miniconda3/bin/conda"
# todo:
# - build and install emacs from source
# - see: https://harryrschwartz.com/2022/12/08/how-i-build-emacs-from-source-on-debian
# - setup doom emacs
# - stow doom emacs file
# - setup org-protocol