Update to macos install
Some checks failed
Lint / Lint (3.10) (push) Failing after 16s
Lint / Lint (3.11) (push) Failing after 19s

This commit is contained in:
Ariejan de Vroom 2024-06-10 16:23:13 +02:00
parent f862c981f7
commit e3aaee336c
Signed by: ariejan
GPG Key ID: AD739154F713697B
9 changed files with 65 additions and 26 deletions

View File

@ -100,7 +100,7 @@ gnome_extensions:
- freon@UshakovVasilii_Github.yahoo.com - freon@UshakovVasilii_Github.yahoo.com
macos: macos:
hostname: "maximum" hostname: "maximus"
dock_apps: dock_apps:
- /System/Applications/Calendar.app - /System/Applications/Calendar.app
- /Applications/Todoist.app - /Applications/Todoist.app
@ -114,6 +114,7 @@ macos:
- /Applications/WhatsApp.app - /Applications/WhatsApp.app
- /Applications/Spotify.app - /Applications/Spotify.app
homebrew_packages: homebrew_packages:
- defaultbrowser
- mas - mas
- tree - tree
- iterm2 - iterm2
@ -139,11 +140,14 @@ macos:
- the_silver_searcher - the_silver_searcher
- jq - jq
- vim - vim
- rbw
- wget - wget
- direnv - direnv
- antidote - antidote
- gnupg - gnupg
- sqlite - sqlite
- pinentry-mac
- gh
mas_remove: mas_remove:
# GarageBand # GarageBand
- 682658836 - 682658836

View File

@ -4,5 +4,6 @@
roles: roles:
- { role: macos_01_hostname } - { role: macos_01_hostname }
- { role: macos_02_packages } - { role: macos_02_packages }
- { role: macos_03_tweaks } - { role: macos_03_user }
- { role: macos_04_tweaks }

View File

@ -26,24 +26,11 @@
validate: /usr/sbin/visudo -cf %s validate: /usr/sbin/visudo -cf %s
become: true become: true
- name: Configure rbw
ansible.builtin.file:
path: ~/.config/rbw
state: directory
mode: '0755'
become: true
become_user: "{{ user.name }}"
- name: Copy rbw-config.json
ansible.builtin.copy:
src: rbw-config.json
dest: ~/.config/rbw/config.json
mode: '0644'
become: true
become_user: "{{ user.name }}"
- name: Configure pinentry for gnome3 - name: Configure pinentry for gnome3
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: ~/.gnupg/gpg-agent.conf path: ~/.gnupg/gpg-agent.conf
line: "pinentry-program /usr/bin/pinentry-gnome3" line: "pinentry-program /usr/bin/pinentry-gnome3"
create: yes create: yes
- name: Install Bitwarden CLI settings
ansible.builtin.import_tasks: rbw.yml

View File

@ -0,0 +1,17 @@
---
- name: Configure rbw
ansible.builtin.file:
path: "{{ '~/Library/Application Support/rbw' if ansible_facts['os_family'] == 'Darwin' else '~/.config/rbw' }}"
state: directory
mode: '0755'
become: true
become_user: "{{ user.name }}"
- name: Copy rbw-config.json
ansible.builtin.copy:
src: rbw-config.json
dest: "{{ '~/Library/Application Support/rbw' if ansible_facts['os_family'] == 'Darwin' else '~/.config/rbw' }}/config.json"
mode: '0644'
become: true
become_user: "{{ user.name }}"

View File

@ -25,3 +25,9 @@
- name: Setup a wallpaper - name: Setup a wallpaper
ansible.builtin.import_tasks: wallpaper.yml ansible.builtin.import_tasks: wallpaper.yml
- name: Configure gpg-agent pinentry
ansible.builtin.lineinfile:
path: ~/.gnupg/gpg-agent.conf
line: "pinentry-program /usr/bin/pinentry-gnome3"
create: yes

View File

@ -0,0 +1,12 @@
---
- name: Install Bitwarden CLI settings
ansible.builtin.include_role:
name: 07_user
tasks_from: rbw
- name: Configure gpg-agent pinentry
ansible.builtin.lineinfile:
path: ~/.gnupg/gpg-agent.conf
line: "pinentry-program /usr/local/bin/pinentry-mac"
create: yes

View File

@ -23,9 +23,6 @@
value: false value: false
state: present state: present
- name: Setup dock apps
community.general.osx_defaults:
- name: Remove all apps from dock - name: Remove all apps from dock
community.general.osx_defaults: community.general.osx_defaults:
domain: com.apple.dock domain: com.apple.dock
@ -40,7 +37,7 @@
key: persistent-apps key: persistent-apps
type: array type: array
array_add: true array_add: true
value: ['{{ item }}'] value: ['<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>{{ item }}</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>']
state: present state: present
with_items: "{{ macos.dock_apps }}" with_items: "{{ macos.dock_apps }}"
@ -122,4 +119,8 @@
- name: Restart SystemUIServer - name: Restart SystemUIServer
ansible.builtin.shell: killall SystemUIServer ansible.builtin.shell: killall SystemUIServer
changed_when: false changed_when: false
- name: Set Firefox as default browser
ansible.builtin.shell: defaultbrowser firefox

View File

@ -9,7 +9,7 @@ echo "--- Symlinking dotfiles"
stow git ruby sqlite tmux vim zsh haskell emacs ssh stow git ruby sqlite tmux vim zsh haskell emacs ssh
echo "--- Install Vim plugins" echo "--- Install Vim plugins"
vim --clean '+source ~/.vimrc' +PluginInstall +qall vim -es -u ~/.vimrc +PluginInstall +qall
echo "--- All done!" echo "--- All done!"
echo "That's all. Please logout of this terminal and login again to apply all changes." echo "That's all. Please logout of this terminal and login again to apply all changes."

View File

@ -1,7 +1,18 @@
#!/usr/bin/env -S bash -i #!/usr/bin/env -S bash -i
copy_to_clipboard() {
if [[ "$OSTYPE" == "darwin"* ]]; then
pbcopy
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
xclip -selection clipboard
else
echo "Unsupported operating system"
exit 1
fi
}
echo "--- Grabbing GPG Passpharse from Bitwarden to clipboard" echo "--- Grabbing GPG Passpharse from Bitwarden to clipboard"
rbw get "GPG Passphrase" | xclip -selection clipboard rbw get "GPG Passphrase" | copy_to_clipboard
echo "--- Importing private/public key" echo "--- Importing private/public key"
rbw get "GPG Private/Pub Key (Ariejan)" | gpg --import rbw get "GPG Private/Pub Key (Ariejan)" | gpg --import