-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.yml
executable file
·143 lines (143 loc) · 5.36 KB
/
local.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
---
- name: Set up worstation based on Ubuntu Server with Sway etc.
hosts: localhost
become: yes
vars:
for_user: joseph
tasks:
- name: Add PPA for alacritty
apt_repository:
repo: 'ppa:aslatter/ppa'
state: present
- name: Add PPA for pipewire
apt_repository:
repo: 'ppa:pipewire-debian/pipewire-upstream'
state: present
- name: Add PPA for wireplumber
apt_repository:
repo: 'ppa:pipewire-debian/wireplumber-upstream'
state: present
- name: Update apt cache and install packages
apt:
name: "{{ item }}"
update_cache: yes
loop:
- zsh
- zsh-syntax-highlighting
- curl
- wget
- unzip
- silversearcher-ag
- pass
- openvpn
- tmux
- build-essential
- sway
- upower
- udisks2
- fzf
- alacritty
- libwayland-egl1
- pipewire
- pipewire-audio-client-libraries
- wireplumber
- cmake
- python-dev-is-python3
- jq
- iptables-persistent
- thunderbird
- swaylock
- brightnessctl
- mako-notifier
- ifstat
- apparmor-utils
- notification-daemon
- mpv
- xdg-desktop-portal-wlr
- name: Install snaps
command: snap install --classic {{item}}
with_items:
- firefox
- chromium
- goland
- signal-desktop
- name: Ensure user directories exist
file: path={{item}} state=directory owner={{for_user}} group={{for_user}} mode=774 recurse=yes
with_items:
- /home/{{for_user}}/.cache/zsh
- /home/{{for_user}}/.config/systemd/user
- /home/{{for_user}}/.config/sway
- /home/{{for_user}}/.config/alacritty
- /home/{{for_user}}/go/bin
- /home/{{for_user}}/go/pkg
- /home/{{for_user}}/go/src
- /home/{{for_user}}/bin
- /home/{{for_user}}/projects
- name: Copy user files
copy: src={{item.src}} dest={{item.dest}} owner={{for_user}} group={{for_user}} mode={{item.mode}} force=no
with_items:
- { src: "files/dotprofile", dest: "/home/{{for_user}}/.profile", mode: 664 }
- { src: "files/dotzshrc", dest: "/home/{{for_user}}/.zshrc", mode: 664 }
- { src: "files/dottmux.conf", dest: "/home/{{for_user}}/.tmux.conf", mode: 664 }
- { src: "files/ssh-agent.service", dest: "/home/{{for_user}}/.config/systemd/user/ssh-agent.service", mode: 664 }
- { src: "files/swayconfig", dest: "/home/{{for_user}}/.config/sway/config", mode: 664 }
- { src: "files/alacritty.toml", dest: "/home/{{for_user}}/.config/alacritty/alacritty.toml", mode: 664 }
- { src: "files/status.sh", dest: "/home/{{for_user}}/.config/sway/status.sh", mode: 774 }
- { src: "files/dotvimrc", dest: "/home/{{for_user}}/.vimrc", mode: 664 }
- { src: "files/dotideavimrc", dest: "/home/{{for_user}}/.ideavimrc", mode: 664 }
- { src: "files/chromium-wayland", dest: "/home/{{for_user}}/bin/chromium-wayland", mode: 774 }
- { src: "files/tor-browser", dest: "/home/{{for_user}}/bin/tor-browser", mode: 774 }
- name: Use zsh
command: usermod --shell /usr/bin/zsh {{for_user}}
- name: Enable user services
become_user: "{{for_user}}"
ansible.builtin.systemd_service:
daemon_reload: true
name: "{{ item }}.service"
state: started
enabled: true
scope: user
loop:
- ssh-agent
- pipewire
- pipewire-pulse
- name: Install zsh autosuggestions
become_user: "{{for_user}}"
git: repo=https://github.com/zsh-users/zsh-autosuggestions.git dest=/home/{{for_user}}/projects/zsh-autosuggestions update=no
- name: Install Vundle
become_user: "{{for_user}}"
git: repo=https://github.com/VundleVim/Vundle.vim.git dest=/home/{{for_user}}/.vim/bundle/Vundle.vim
- name: Install Vim plugins
become_user: "{{for_user}}"
shell: vim -E -s -c "source /home/{{for_user}}/.vimrc" -c PluginInstall -c qa
ignore_errors: yes
- name: Install Go
shell: |
wget -c https://storage.googleapis.com/golang/go1.21.6.linux-amd64.tar.gz
tar -C /usr/local -xvzf go1.21.6.linux-amd64.tar.gz
rm go1.21.6.linux-amd64.tar.gz
- name: Install YouCompleteMe
become_user: "{{for_user}}"
shell: |
export PATH=$PATH:/usr/local/go/bin
cd /home/{{for_user}}/.vim/bundle/YouCompleteMe
./install.py --go-completer
- name: Clone adsorber
become_user: "{{for_user}}"
git: repo=https://github.com/stablestud/adsorber.git dest=/home/{{for_user}}/projects/adsorber update=no
- name: Run adsorber
shell: |
cd /home/{{for_user}}/projects/adsorber
./portable_adsorber.sh enable
./src/bin/adsorber enable --no-schedule --yes
- name: Install Tor Browser
become_user: "{{for_user}}"
shell: |
cd /home/{{for_user}}
wget -c https://www.torproject.org/dist/torbrowser/13.0.10/tor-browser-linux-x86_64-13.0.10.tar.xz
tar -xvJf tor-browser-linux-x86_64-13.0.10.tar.xz
rm tor-browser-linux-x86_64-13.0.10.tar.xz
- name: Allow brightnessctl as non-root user
command: chmod +s $(which brightnessctl)
- name: Disable Apparmor for Mako
command: aa-disable /etc/apparmor.d/fr.emersion.Mako