Skip to content

Commit

Permalink
feat: working through the issues of a new computer.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePrimeagen committed Nov 1, 2021
1 parent 8b5a595 commit 5b1d263
Show file tree
Hide file tree
Showing 11 changed files with 339 additions and 188 deletions.
346 changes: 173 additions & 173 deletions .ssh/id_rsa

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
### Vim plug is not installing in the correct location
??

## Ohmyzsh
* doesn't work because of the user.
* also you cannot re-install it or else it breaks.
* had to put a little file exist protector

## keyboard
1 Couldn't be detected
2 / is not working

### Fix 1
sudo mkdir -p /etc/udev/rules.d/
echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666", TAG+="uaccess", TAG+="udev-acl"' | sudo tee /etc/udev/rules.d/92-viia.rules
sudo udevadm control --reload-rules
sudo udevadm trigger

### Fix 2
swapped out / key for /? key. This seems to be the correct move.

### Permissions with ssh
I think its a user issue. I think that if I redo it with --become-user theprimeagen it will work better.
remove all become_user root

### Plug
I manually installed it..
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
### NVIM
bad order of tasks.

### NVIDIA Drivers
* I just don't have them...

### Where was shutter
* Come on, man

### Ansible pull
no vault
make it clone
--become-user theprimeagen
-t install . I just keep forgetting this...

### Personal projects
- I have to check for existance before doing anything else. Else it doesn't
quite work.
15 changes: 10 additions & 5 deletions local.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
- hosts: localhost
become: true
vars:
source_key: "./.ssh/id_rsa"
dest_key: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa"
personal: "{{ lookup('env', 'HOME') }}/personal"
pre_tasks:
- name: update repositories
apt: update_cache=yes
changed_when: False
- name: Install packages only when the apt process isn't locked
become: true
apt:
force_apt_get: true
update_cache: true
state: present
tasks:
- include: tasks/ssh.yml
- include: tasks/git-setup.yml
- include: tasks/core-setup.yml
- include: tasks/node-setup.yml
- include: tasks/npm-packages.yml
- include: tasks/zsh-setup.yml
- include: tasks/slack-setup.yml
- include: tasks/personal-projects.yml
- include: tasks/nvim-setup.yml
- include: tasks/brave.yml
- include: tasks/dotfiles.yml
- include: tasks/personal-projects.yml
- include: tasks/productivity-tools.yml

2 changes: 0 additions & 2 deletions tasks/core-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@
tags:
- install
- core


3 changes: 3 additions & 0 deletions tasks/dotfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
tags:
- install
- dotfiles
- stow
- name: Cloning .dotfiles
ansible.builtin.git:
repo: '[email protected]:ThePrimeagen/.dotfiles.git'
Expand All @@ -14,8 +15,10 @@
tags:
- install
- dotfiles
- stow
- name: Stow dotfiles
shell: cd $HOME/.dotfiles && ./ubuntu
tags:
- install
- dotfiles
- stow
14 changes: 14 additions & 0 deletions tasks/git-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: Git personal setup email
git_config:
name: user.email
scope: global
value: "[email protected]"
tags:
- git-personal
- name: Git personal setup name
git_config:
name: user.name
scope: global
value: "ThePrimeagen"
tags:
- git-personal
2 changes: 1 addition & 1 deletion tasks/nvim-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- install
- neovim
- name: Install Vim-Plug
shell: curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
shell: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
tags:
- install
- dotfiles
Expand Down
63 changes: 59 additions & 4 deletions tasks/personal-projects.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,115 @@
- name: Harpoon exists
stat:
path: "{{ personal }}/harpoon"
register: harpoon
tags:
- install
- dotfiles
- neovim
- personal-project
- name: Personal Project Harpoon
ansible.builtin.git:
repo: '[email protected]:ThePrimeagen/harpoon.git'
bare: true
dest: "{{ lookup('env', 'HOME') }}/personal/harpoon"
dest: "{{ personal }}/harpoon"
tags:
- install
- dotfiles
- neovim
- personal-project
when: harpoon.stat.exists == False
- name: Harpoon Master Checkout
shell: cd ~/personal/harpoon && git fetch && git worktree add master master
tags:
- install
- dotfiles
- neovim
- personal-project
when: harpoon.stat.exists == False

- name: git-worktree exists
stat:
path: "{{ personal }}/git-worktree.nvim"
register: worktree
tags:
- install
- dotfiles
- neovim
- personal-project
- name: Personal Project Git-Worktrees
ansible.builtin.git:
repo: '[email protected]:ThePrimeagen/git-worktree.nvim.git'
bare: true
dest: "{{ lookup('env', 'HOME') }}/personal/git-worktree.nvim"
dest: "{{ personal }}/git-worktree.nvim"
tags:
- install
- dotfiles
- neovim
- personal-project
when: worktree.stat.exists == False
- name: Git worktree Master Checkout
shell: cd ~/personal/git-worktree.nvim && git fetch && git worktree add master master
tags:
- install
- neovim
- dotfiles
- personal-project
when: worktree.stat.exists == False

- name: refactoring exists
stat:
path: "{{ personal }}/refactoring.nvim"
register: refactoring
tags:
- install
- dotfiles
- neovim
- personal-project
- name: Personal Project Refactoring
ansible.builtin.git:
repo: '[email protected]:ThePrimeagen/refactoring.nvim'
bare: true
dest: "{{ lookup('env', 'HOME') }}/personal/refactoring.nvim"
dest: "{{ personal }}/refactoring.nvim"
tags:
- install
- personal-project
- neovim
- dotfiles
when: refactoring.stat.exists == False
- name: Refactoring checkout
shell: cd ~/personal/refactoring.nvim && git fetch && git worktree add master master
tags:
- install
- dotfiles
- neovim
- personal-project
when: refactoring.stat.exists == False

- name: vim-with-me exists
stat:
path: "{{ personal }}/vim-with-me"
register: vwm
tags:
- install
- dotfiles
- neovim
- personal-project
- name: Personal Project Vim With Me
ansible.builtin.git:
repo: '[email protected]:ThePrimeagen/vim-with-me'
bare: true
dest: "{{ lookup('env', 'HOME') }}/personal/vim-with-me"
dest: "{{ personal }}/vim-with-me"
tags:
- install
- personal-project
- neovim
- dotfiles
when: vwm.stat.exists == False
- name: vim-with-me checkout
shell: cd ~/personal/vim-with-me && git fetch && git worktree add ui ui
tags:
- install
- dotfiles
- neovim
- personal-project
when: vwm.stat.exists == False
13 changes: 11 additions & 2 deletions tasks/ssh.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
- name: Ensure .ssh directory exists.
become_user: root
file:
dest: "{{ dest_key | dirname }}"
mode: 0700
Expand All @@ -9,7 +8,6 @@
- install
- ssh
- name: Install ssh key
become_user: root
copy:
src: "{{ source_key }}"
dest: "{{ dest_key }}"
Expand All @@ -18,8 +16,19 @@
- dotfiles
- install
- ssh
- name: Install ssh key public
copy:
src: "{{ source_key }}.pub"
dest: "{{ dest_key }}.pub"
mode: 0644
tags:
- dotfiles
- install
- ssh
- name: Set authorized key took from file
authorized_key:
user: "{{ lookup('env', 'USER') }}"
state: present
key: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa.pub"
with_fileglob:
- "{{ lookup('env', 'HOME') }}/.ssh/*.pub"
16 changes: 15 additions & 1 deletion tasks/zsh-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,27 @@
- dotfiles
- productivity
- zsh

- name: Check that the somefile.conf exists
stat:
path: /home/theprimeagen/.oh-my-zsh
register: oh_my_stats
tags:
- install
- productivity
- dotfiles
- zsh

- name: Oh-My-Zsh
shell: curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
shell: curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh > ~/.oh-my-installer && chmod +x ~/.oh-my-installer && ~/.oh-my-installer
tags:
- install
- productivity
- dotfiles
- zsh
when: oh_my_stats.stat.exists == False
become_user: theprimeagen

- name: Install zsh-autosuggestions
ansible.builtin.git:
repo: 'https://github.com/zsh-users/zsh-autosuggestions.git'
Expand Down
6 changes: 6 additions & 0 deletions test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- hosts: localhost
tasks:
- name: Update apt
become: true
apt:
update_cache: true

0 comments on commit 5b1d263

Please sign in to comment.