Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev → Main #2

Merged
merged 23 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
38 changes: 2 additions & 36 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,3 @@
# dotfiles
# Kiliantyler's Dotfiles

Documentation is a work in progress.

As is this whole repo...

<!-- TODO: Make documentation -->

<!-- Make docusaurus -->

## chezmoi

## zsh

## zidote

## trunk

### commitlint

## editorrc

## go-task

## direnv

## asdf

## homebrew

## comtrya

## age

## 1Password

## vscode
[Wiki](https://dotfiles.wiki)
1 change: 1 addition & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,17 @@ cython_debug/
# Ignore TODO files
*.TODO

##################################################
## ##
## Ansible ##
## ##
##################################################

ansible/collections/
ansible/facts/
ansible/tmp/
ansible/logs/
ansible/galaxy_cache/

##################################################
## ##
Expand Down
7 changes: 7 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tools]
task = "3.38.0"
node = "22.5.1"
age = "1.2.0"
1password-cli = "2.30.0"
trunk = "1.22.3"
bun = "1.1.27"
3 changes: 2 additions & 1 deletion .taskfiles/ansible/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tasks:
init:
desc: "Initialize ansible"
cmds:
- /usr/bin/python3 -m pip install --user -r "{{.ANSIBLE_DIR}}/requirements.txt"
- ansible-galaxy install -r "{{.ANSIBLE_DIR}}/requirements.yaml"

run:
Expand All @@ -19,4 +20,4 @@ tasks:
deps:
- init
cmds:
- ansible-playbook "{{.ANSIBLE_DIR}}/playbook.yaml"
- ansible-playbook "{{.ANSIBLE_DIR}}/playbooks/playbook.yaml"
6 changes: 0 additions & 6 deletions .tool-versions

This file was deleted.

1 change: 0 additions & 1 deletion ansible/.gitignore

This file was deleted.

677 changes: 12 additions & 665 deletions ansible/ansible.cfg

Large diffs are not rendered by default.

File renamed without changes.
2,014 changes: 0 additions & 2,014 deletions ansible/log.txt

This file was deleted.

16 changes: 13 additions & 3 deletions ansible/playbook.yaml → ansible/playbooks/playbook.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# yaml-language-server $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json
- name: Set up local development environment
- name: Set up local environment
hosts: local
roles:
- {role: install_programs, tags: ['install_programs']}
# - {role: os, tags: ['os']}
# - {role: vscode, tags: ['vscode']}
- role: os
tags:
- os
- personal
- work
- workstation
- role: mise
tags:
- mise
- programs
- personal
- work
File renamed without changes.
2 changes: 2 additions & 0 deletions ansible/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ansible==8.7.0
github3.py==4.0.1
File renamed without changes.
51 changes: 51 additions & 0 deletions ansible/roles/mise/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# yaml-language-server $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json

- name: Get latest mise release from Github
community.general.github_release:
user: jdx
repo: mise
action: latest_release
register: mise_latest

- name: Create a temporary directory for mise
tempfile:
state: directory
register: temp_dir

- name: Download and extract mise from Github Release
ansible.builtin.unarchive:
src: "https://github.com/jdx/mise/releases/download/{{ mise_latest['tag'] }}/mise-{{ mise_latest['tag'] }}-{{ ('macos' if ansible_os_family == 'Darwin' else 'linux') }}-{{ ('x64' if ansible_architecture == 'x86_64' else ansible_architecture) }}.tar.gz"
dest: "{{ temp_dir.path }}"
remote_src: true

- name: Ensure ~/.local/bin directory exists
ansible.builtin.file:
path: $HOME/.local/bin
state: directory
owner: "{{ ansible_user_id }}"
recurse: yes

- name: Move mise binary to ~/.local/bin
ansible.builtin.copy:
src: "{{ temp_dir.path }}/mise/bin/mise"
dest: $HOME/.local/bin/mise
mode: 0755
owner: "{{ ansible_user_id }}"

- name: Check if $XDG_DATA_HOME is set
ansible.builtin.shell: |
echo ${XDG_DATA_HOME:-$HOME/.local/share}
register: xdg_data_home
ignore_errors: true

- name: Ensure $XDG_DATA_HOME/man/man1 directory exists
ansible.builtin.file:
path: "{{ xdg_data_home.stdout }}/man/man1"
state: directory
owner: "{{ ansible_user_id }}"
recurse: yes

- name: Move mise man pages
ansible.builtin.copy:
src: "{{ temp_dir.path }}/mise/man/man1/mise.1"
dest: "{{ xdg_data_home.stdout }}/man/man1/mise.1"
Empty file.
3 changes: 3 additions & 0 deletions ansible/roles/os/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Common OS Ansible Role

[Documentaion available here](https://dotfiles.wiki/tools/ansible/os/common/)
1 change: 1 addition & 0 deletions ansible/roles/os/common/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Create ~/.tmp
Empty file.
3 changes: 3 additions & 0 deletions ansible/roles/os/debian/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Debian Ansible Role

[Documentaion available here](https://dotfiles.wiki/tools/ansible/os/debian/)
3 changes: 3 additions & 0 deletions ansible/roles/os/macos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MacOS Ansible Role

[Documentaion available here](https://dotfiles.wiki/tools/ansible/os/macos/)
45 changes: 45 additions & 0 deletions ansible/roles/os/macos/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# yaml-language-server $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json

Defaults:
Dock:
ScrollToOpen: true
ShowAppExposeGestureEnabled: false
ShowHidden: true
Pinning: middle
MinimizeToApplication: true
NoBouncing: false
Animations:
Launch: true
MinimizeEffect: suck
Autohide:
Enabled: true
AnimationDuration: 0.25
Delay: 0.1
Icons:
Size: 42
Magnification: true
MagnificationSize: 44
Position: left
ShowRecents: false

Finder:
ShowFileExtensions: true
ShowHiddenFiles: true
ShowPathBar: true
PreferredViewStyle: Nlsv
ShowStatusBar: true
SearchScope: SCcf
RemoveOldTrash: true
ChangeExtensionWarning: false
TitlebarIcon: true
SidebarIconSize: 3

Desktop:
ShowHardDrives: false
ShowExternalHardDrives: false
ShowRemovableMedia: false
ShowMountedServers: false
ShowIcons: false

Menubar:
FlashClock: true
4 changes: 4 additions & 0 deletions ansible/roles/os/macos/handlers/dockRestart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# yaml-language-server $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json
- name: Dock Restart
ansible.builtin.command:
cmd: "killall Dock"
4 changes: 4 additions & 0 deletions ansible/roles/os/macos/handlers/finderRestart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# yaml-language-server $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json
- name: Finder Restart
ansible.builtin.command:
cmd: "killall Finder"
3 changes: 3 additions & 0 deletions ansible/roles/os/macos/handlers/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# yaml-language-server $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json
- ansible.builtin.import_tasks: dockRestart.yaml
- ansible.builtin.import_tasks: finderRestart.yaml
46 changes: 46 additions & 0 deletions ansible/roles/os/macos/tasks/defaults_desktop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# yaml-language-server $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json

- name: "[DESKTOP] Hard Drives on Desktop"
community.general.osx_defaults:
domain: com.apple.finder
key: ShowHardDrivesOnDesktop
type: bool
value: "{{ Defaults.Desktop.ShowHardDrives }}"
state: present
notify: Finder Restart

- name: "[DESKTOP] External Hard Drives on Desktop"
community.general.osx_defaults:
domain: com.apple.finder
key: ShowExternalHardDrivesOnDesktop
type: bool
value: "{{ Defaults.Desktop.ShowExternalHardDrives }}"
state: present
notify: Finder Restart

- name: "[DESKTOP] Removable Media on Desktop"
community.general.osx_defaults:
domain: com.apple.finder
key: ShowRemovableMediaOnDesktop
type: bool
value: "{{ Defaults.Desktop.ShowRemovableMedia }}"
state: present
notify: Finder Restart

- name: "[DESKTOP] Mounted Servers on Desktop"
community.general.osx_defaults:
domain: com.apple.finder
key: ShowMountedServersOnDesktop
type: bool
value: "{{ Defaults.Desktop.ShowMountedServers }}"
state: present
notify: Finder Restart

- name: "[DESKTOP] Desktop Icons"
community.general.osx_defaults:
domain: com.apple.finder
key: CreateDesktop
type: bool
value: "{{ Defaults.Desktop.ShowIcons }}"
state: present
notify: Finder Restart
Loading