diff --git a/dotfiles.yml b/dotfiles.yml index 839309c..531ced4 100644 --- a/dotfiles.yml +++ b/dotfiles.yml @@ -3,22 +3,28 @@ tasks: - include_vars: file: vars.yml - - import_tasks: tasks/common.yml + - import_tasks: tasks/user.yml - import_tasks: tasks/packages.yml - - import_tasks: tasks/config.yml + - import_tasks: tasks/python.yml - import_tasks: tasks/vim.yml - - import_tasks: tasks/private.yml + - import_tasks: tasks/intersect.yml - import_tasks: tasks/vscode.yml - import_tasks: tasks/gnome.yml - import_tasks: tasks/i3.yml - - import_tasks: tasks/services.yml - import_tasks: tasks/shell.yml - import_tasks: tasks/fonts.yml - import_tasks: tasks/autostart.yml + - import_tasks: tasks/power-saving.yml + - import_tasks: tasks/display.yml + - import_tasks: tasks/javascript.yml + - import_tasks: tasks/applications.yml + - import_tasks: tasks/boot.yml + - import_tasks: tasks/dev.yml + - import_tasks: tasks/input.yml + - import_tasks: tasks/media.yml + - import_tasks: tasks/security.yml - import_tasks: tasks/dabapps.yml when: ansible_fqdn == "TOO-Work" - - import_tasks: tasks/laptop.yml - when: ansible_fqdn == "TOO-Laptop" - import_tasks: tasks/cleanup.yml diff --git a/files/caret-preferences.md b/files/caret-preferences.md deleted file mode 100644 index bb7d230..0000000 --- a/files/caret-preferences.md +++ /dev/null @@ -1,14 +0,0 @@ -# Preferences - -Edit and save to update preferences: - -```yaml -useProportionalFontInProse: Roboto # set to false to disable -useLargeFontInHeadings: "Roboto" # set to false to disable -font: "Fira Mono" -fontSize: 15 -lineHeight: 1.8 -lineWidth: 100 -``` - -More options coming soon. diff --git a/tasks/applications.yml b/tasks/applications.yml new file mode 100644 index 0000000..d949703 --- /dev/null +++ b/tasks/applications.yml @@ -0,0 +1,37 @@ +- name: "Install general applications" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'bleachbit' + - 'brave-bin' + - 'caprine' + - 'clamtk' + - 'corebird' + - 'etcher' + - 'filezilla' + - 'firefox' + - 'gimp' + - 'ghostwriter' + - 'glogg' + - 'google-earth-pro' + - 'gparted' + - 'inkscape' + - 'kdenlive' + - 'kodi' + - 'minecraft' + - 'obs-studio' + - 'onlyoffice-bin' + - 'slack-desktop' + - 'steam' + - 'thunderbird' + - 'tor-browser' + - 'virtualbox' + - 'vivaldi' + - 'vlc' + - 'whatsie' + - 'wps-office' + - 'wps-office-extension-english-uk-dictionary' diff --git a/tasks/autostart.yml b/tasks/autostart.yml index 5b63ccd..72d5c7e 100644 --- a/tasks/autostart.yml +++ b/tasks/autostart.yml @@ -1,3 +1,13 @@ +- name: "Install autostart-related packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'dex' + - file: src: "/etc/xdg/autostart/{{ item }}.desktop" dest: "{{ home }}/.config/autostart/{{ item }}.desktop" diff --git a/tasks/boot.yml b/tasks/boot.yml new file mode 100644 index 0000000..bd8bfa6 --- /dev/null +++ b/tasks/boot.yml @@ -0,0 +1,31 @@ +- name: "Install Grub" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'grub-customizer' + - 'grub2-theme-archlinux' + - 'ly-git' + +- service: + name: "lightdm" + enabled: false + +- service: + name: "gdm" + enabled: false + +- service: + name: "ly" + enabled: true + +- service: + name: "getty@tty2" + enabled: false + +- modprobe: + name: pcspkr + state: absent diff --git a/tasks/config.yml b/tasks/config.yml deleted file mode 100644 index 6e7b4c7..0000000 --- a/tasks/config.yml +++ /dev/null @@ -1,50 +0,0 @@ -- copy: - src: ./files/libinput-gestures.conf - dest: /etc/libinput-gestures.conf - mode: 0644 - owner: "{{ user }}" - -- template: - src: ./files/gitconfig.conf - dest: "{{ home }}/.gitconfig" - mode: 0644 - owner: "{{ user }}" - group: users - -- copy: - src: ./files/touchpad.conf - dest: /usr/share/X11/xorg.conf.d/30-touchpad.conf - mode: 0644 - owner: "{{ user }}" - -- copy: - src: ./files/assh.yml - dest: "{{ home}}/.ssh/assh.yml" - mode: 0644 - owner: "{{ user }}" - -- set_fact: - user_config_files: - - {src: "terminator.conf", dest: "{{ home }}/.config/terminator/config"} - - {src: "uniemoji.json", dest: "{{ home }}/.config/uniemoji/custom.json"} - - {src: "gitignore_global", dest: "{{ home }}/.config/.gitignore"} - - {src: "rofi.conf", dest: "{{ home }}/.config/rofi/config"} - - {src: "caret-preferences.md", dest: "{{ home }}/.config/Caret/Preferences.md"} - - {src: "alacritty.yml", dest: "{{ home }}/.config/alacritty/alacritty.yml"} - - -- name: "Create config file directories" - with_items: "{{ user_config_files }}" - file: - path: '{{ item.dest | dirname }}' - state: directory - owner: "{{ user }}" - mode: 0755 - -- name: "Copy config files" - with_items: "{{ user_config_files }}" - copy: - src: './files/{{ item.src }}' - dest: '{{ item.dest }}' - mode: 0644 - owner: "{{ user }}" diff --git a/tasks/dabapps.yml b/tasks/dabapps.yml index ad6d9bb..261f3d5 100644 --- a/tasks/dabapps.yml +++ b/tasks/dabapps.yml @@ -1,3 +1,18 @@ +- name: "Install DabApps packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'redis' + +- service: + name: "redis" + enabled: true + + - name: "DabApps Dotfiles" git: repo: git@github.com:dabapps/dotfiles @@ -13,7 +28,3 @@ owner: "{{ user }}" state: link force: true - -- modprobe: - name: pcspkr - state: absent diff --git a/tasks/dev.yml b/tasks/dev.yml new file mode 100644 index 0000000..193a901 --- /dev/null +++ b/tasks/dev.yml @@ -0,0 +1,32 @@ +- name: "Install dev packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'arduino' + - 'arduino-cli' + - 'arduino-builder' + - 'hugo' + - 'jdk' + - 'postgresql' + - 'postman-bin' + - 'sublime-text' + - 'tig' + - 'zola-bin' + +- name: "Create global .gitignore" + copy: + src: './files/gitignore_global' + dest: '{{ home }}/.config/.gitignore' + mode: 0644 + owner: "{{ user }}" + +- template: + src: ./files/gitconfig.conf + dest: "{{ home }}/.gitconfig" + mode: 0644 + owner: "{{ user }}" + group: users diff --git a/tasks/display.yml b/tasks/display.yml new file mode 100644 index 0000000..7eec0c7 --- /dev/null +++ b/tasks/display.yml @@ -0,0 +1,12 @@ +- name: "Install display packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'arandr' + - 'lxappearance' + - 'lxrandr' + - 'redshift' diff --git a/tasks/fonts.yml b/tasks/fonts.yml index 1d8858a..0f7ed29 100644 --- a/tasks/fonts.yml +++ b/tasks/fonts.yml @@ -1,3 +1,21 @@ +- name: "Install font packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + # - 'all-repository-fonts' + - 'fonts-meta-extended-lt' + - 'otf-fira-code' + - 'otf-font-awesome' + - 'ttf-emojione' + - 'ttf-fira-code' + - 'ttf-font-awesome' + - 'ttf-ms-fonts' + - 'ttf-wps-fonts' + - file: src: "/etc/fonts/conf.avail/{{ item }}" dest: "/etc/fonts/conf.d/{{ item }}" diff --git a/tasks/i3.yml b/tasks/i3.yml index a7c22c4..609fc98 100644 --- a/tasks/i3.yml +++ b/tasks/i3.yml @@ -1,3 +1,28 @@ +- name: "Install i3 packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'betterlockscreen' + - 'brightnessctl' + - 'compton' + - 'dmenu' + - 'dunst' + - 'feh' + - 'flameshot' + - 'i3-gaps' + - 'i3lock-color-git' + - 'lxqt-policykit' + - 'numix-gtk-theme' + - 'aur/polybar' + - 'qt5-styleplugins' + - 'rofi' + - 'tbg' + + - set_fact: polybar_scripts: "{{ home }}/.config/polybar/polybar-scripts/polybar-scripts" i3_config_files: @@ -47,18 +72,17 @@ owner: "{{ user }}" group: users -- service: - name: "lightdm" - enabled: false -- service: - name: "gdm" - enabled: false +- name: "Create rofi config directory" + file: + path: '{{ home }}/.config/rofi/' + state: directory + owner: "{{ user }}" + mode: 0755 -- service: - name: "ly" - enabled: true - -- service: - name: "getty@tty2" - enabled: false +- name: "Create rofi config" + copy: + src: './files/alacritty.yml' + dest: '{{ home }}/.config/rofi/config' + mode: 0644 + owner: "{{ user }}" diff --git a/tasks/input.yml b/tasks/input.yml new file mode 100644 index 0000000..f85477f --- /dev/null +++ b/tasks/input.yml @@ -0,0 +1,39 @@ +- name: "Install input packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'ibus' + - 'ibus-uniemoji' + - 'libinput' + - 'libinput-gestures' + - 'solaar' + +- copy: + src: ./files/touchpad.conf + dest: /usr/share/X11/xorg.conf.d/30-touchpad.conf + mode: 0644 + owner: "{{ user }}" + +- copy: + src: ./files/libinput-gestures.conf + dest: /etc/libinput-gestures.conf + mode: 0644 + owner: "{{ user }}" + +- name: "Create uniemoji config directory" + file: + path: '{{ home }}/.config/uniemoji/' + state: directory + owner: "{{ user }}" + mode: 0755 + +- name: "Create uniemoji config" + copy: + src: './files/uniemoji.json' + dest: '{{ home }}/.config/uniemoji/custom.json' + mode: 0644 + owner: "{{ user }}" diff --git a/tasks/intersect.yml b/tasks/intersect.yml new file mode 100644 index 0000000..fc9a14d --- /dev/null +++ b/tasks/intersect.yml @@ -0,0 +1,22 @@ +- name: "Install intersect packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'calibre' + - 'deluge' + - 'enpass-bin' + - 'feedreader' + - 'hexchat' + - 'nextcloud-client' + - 'turtl' + + +- file: + state: directory + path: "{{ home }}/.dotfiles" + owner: "{{ user }}" + group: users diff --git a/tasks/javascript.yml b/tasks/javascript.yml new file mode 100644 index 0000000..f2a2f53 --- /dev/null +++ b/tasks/javascript.yml @@ -0,0 +1,10 @@ +- name: "Install Javascript packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'nodejs' + - 'nvm' diff --git a/tasks/media.yml b/tasks/media.yml new file mode 100644 index 0000000..51c3b44 --- /dev/null +++ b/tasks/media.yml @@ -0,0 +1,22 @@ +- name: "Install Spotify" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'ffmpeg-compat-57' + - 'spotify' + +- name: "Install media-related packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'bcm20702a1-firmware' + - 'bluez-firmware' + - 'handbrake' diff --git a/tasks/packages.yml b/tasks/packages.yml index b982e35..6f2923b 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -23,9 +23,6 @@ dest: /etc/pacman.conf mode: 0644 -- pacman: - update_cache: true - - user: name: aur_builder group: wheel @@ -45,6 +42,7 @@ become_user: aur_builder register: installed_packages + - name: "Install yay" aur: skip_installed: true @@ -52,166 +50,12 @@ become: true become_user: aur_builder -- name: "Install initial packages" +- name: "Install additional repo keyrings" aur: - use: yay skip_installed: true name: "{{ item }}" become: true become_user: aur_builder when: "item not in installed_packages.stdout_lines" with_items: - - 'i3-gaps' - - 'all-repository-fonts' - - 'i3lock-color-git' - -- name: "Install packages" - aur: - use: yay - skip_installed: true - name: "{{ item }}" - become: true - become_user: aur_builder - when: "item not in installed_packages.stdout_lines" - with_items: - - 'acpi' - - 'advanced-ssh-config' - - 'alacritty' - - 'android-tools' - - 'arandr' - 'archstrike-keyring' - - 'arduino' - - 'arduino-cli' - - 'arduino-builder' - - 'bat' - - 'bcm20702a1-firmware' - - 'betterlockscreen' - - 'bleachbit' - - 'bluez-firmware' - - 'brave-bin' - - 'brightnessctl' - - 'calibre' - - 'caprine' - - 'catimg' - - 'climate' - - 'clamtk' - - 'community/code' - - 'corebird' - - 'compton' - - 'deluge' - - 'dex' - - 'dmenu' - - 'dunst' - - 'enpass-bin' - - 'etcher' - - 'exa' - - 'fasd' - - 'fd' - - 'feedreader' - - 'feh' - - 'ffmpeg-compat-57' - - 'filezilla' - - 'firefox' - - 'flameshot' - - 'fonts-meta-extended-lt' - - 'gimp' - - 'ghostwriter' - - 'glogg' - - 'google-earth-pro' - - 'gparted' - - 'grub-customizer' - - 'grub2-theme-archlinux' - - 'gvim' - - 'handbrake' - - 'hexchat' - - 'htop' - - 'hugo' - - 'ibus' - - 'ibus-uniemoji' - - 'inkscape' - - 'jdk' - - 'jshon' - - 'kdenlive' - - 'keybase-bin' - - 'kodi' - - 'libinput' - - 'libinput-gestures' - - 'lxappearance' - - 'lxrandr' - - 'lxqt-policykit' - - 'ly-git' - - 'minecraft' - - 'mullvad-vpn' - - 'networkmanager-wireguard-git' - - 'nextcloud-client' - - 'nnn' - - 'nodejs' - - 'numix-gtk-theme' - - 'nvm' - - 'obs-studio' - - 'oh-my-zsh-git' - - 'onlyoffice-bin' - - 'otf-fira-code' - - 'otf-font-awesome' - - 'perl-file-mimeinfo' - - 'pigz' - - 'playerctl' - - 'aur/polybar' - - 'postgresql' - - 'postman-bin' - - 'powertop' - - 'psensor' - - 'pulseaudio-bluetooth-a2dp-gdm-fix' - - 'pyenv' - - 'python-pip' - - 'python-virtualenv' - - 'python2-pip' - - 'python2-virtualenv' - - 'qomui' - - 'qt5-styleplugins' - - 'redis' - - 'redshift' - - 'reptyr' - - 'ripgrep' - - 'rofi' - - 'scrcpy' - - 'screenfetch' - - 'sl' - - 'slack-desktop' - - 'solaar' - - 'spotify' - - 'steam' - - 'sublime-text' - - 'sysstat' - - 'tbg' - - 'terminator' - - 'thefuck' - - 'thunderbird' - - 'tig' - - 'tmux' - - 'tor-browser' - - 'ttf-emojione' - - 'ttf-fira-code' - - 'ttf-font-awesome' - - 'ttf-ms-fonts' - - 'ttf-wps-fonts' - - 'turtl' - - 'universal-ctags-git' - - 'vim-pathogen' - - 'virtualbox' - - 'vivaldi' - - 'vlc' - - 'whatsie' - - 'wireguard-arch' - - 'wireguard-tools' - - 'wps-office' - - 'wps-office-extension-english-uk-dictionary' - - 'zola-bin' - - 'zsh' - - 'zsh-completions' - - 'zsh-doc' - - 'zsh-syntax-highlighting' - -- service: - name: "mullvad-daemon" - enabled: true diff --git a/tasks/laptop.yml b/tasks/power-saving.yml similarity index 54% rename from tasks/laptop.yml rename to tasks/power-saving.yml index fd29e14..d46ba9b 100644 --- a/tasks/laptop.yml +++ b/tasks/power-saving.yml @@ -1,13 +1,17 @@ - name: "Install power-saving stuff" aur: - use: yay skip_installed: true name: "{{ item }}" become: true become_user: aur_builder + when: "item not in installed_packages.stdout_lines" with_items: + - 'acpi' - ethtool + - 'powertop' + - 'psensor' - smartmontools + - 'sysstat' - tlp - name: Enable TLP services @@ -22,3 +26,15 @@ src: ./files/tlp.conf dest: /etc/default/tlp mode: 0644 + +- copy: + src: ./files/powertop.service + dest: /etc/systemd/system/powertop.service + mode: 0644 + owner: root + directory_mode: true + +- service: + name: "powertop" + enabled: true + state: started diff --git a/tasks/private.yml b/tasks/private.yml deleted file mode 100644 index 4e47a10..0000000 --- a/tasks/private.yml +++ /dev/null @@ -1,5 +0,0 @@ -- file: - state: directory - path: "{{ home }}/.dotfiles" - owner: "{{ user }}" - group: users diff --git a/tasks/python.yml b/tasks/python.yml new file mode 100644 index 0000000..612621f --- /dev/null +++ b/tasks/python.yml @@ -0,0 +1,19 @@ +- name: "Install python packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'pyenv' + - 'python-pip' + - 'python-virtualenv' + - 'python2-pip' + - 'python2-virtualenv' + +- file: + state: directory + path: '/opt/pyenv' + owner: "{{ user }}" + group: users diff --git a/tasks/security.yml b/tasks/security.yml new file mode 100644 index 0000000..58b8237 --- /dev/null +++ b/tasks/security.yml @@ -0,0 +1,24 @@ +- name: "Install security-related packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'keybase-bin' + - 'mullvad-vpn' + - 'networkmanager-wireguard-git' + - 'qomui' + - 'wireguard-arch' + - 'wireguard-tools' + +- service: + name: "mullvad-daemon" + enabled: true + +- copy: + src: ./files/assh.yml + dest: "{{ home}}/.ssh/assh.yml" + mode: 0644 + owner: "{{ user }}" diff --git a/tasks/services.yml b/tasks/services.yml deleted file mode 100644 index bdfbe12..0000000 --- a/tasks/services.yml +++ /dev/null @@ -1,11 +0,0 @@ -- copy: - src: ./files/powertop.service - dest: /etc/systemd/system/powertop.service - mode: 0644 - owner: root - directory_mode: true - -- service: - name: "powertop" - enabled: true - state: started diff --git a/tasks/shell.yml b/tasks/shell.yml index 39309cc..49d2e82 100644 --- a/tasks/shell.yml +++ b/tasks/shell.yml @@ -1,3 +1,40 @@ +- name: "Install input packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'advanced-ssh-config' + - 'alacritty' + - 'bat' + - 'catimg' + - 'climate' + - 'exa' + - 'fasd' + - 'fd' + - 'htop' + - 'jshon' + - 'nnn' + - 'oh-my-zsh-git' + - 'perl-file-mimeinfo' + - 'pigz' + - 'playerctl' + - 'reptyr' + - 'ripgrep' + - 'scrcpy' + - 'screenfetch' + - 'sl' + - 'terminator' + - 'thefuck' + - 'tmux' + - 'zsh' + - 'zsh-completions' + - 'zsh-doc' + - 'zsh-syntax-highlighting' + + - template: src: ./files/zshrc/.zshrc dest: "{{ home }}/.zshrc" @@ -27,3 +64,33 @@ force: true become: true become_user: "{{ user }}" + + +- name: "Create alacritty config directory" + file: + path: '{{ home }}/.config/alacritty/' + state: directory + owner: "{{ user }}" + mode: 0755 + +- name: "Create alacritty config" + copy: + src: './files/alacritty.yml' + dest: '{{ home }}/.config/alacritty/alacritty.yml' + mode: 0644 + owner: "{{ user }}" + + +- name: "Create terminator directory" + file: + path: '{{ home }}/.config/terminator/' + state: directory + owner: "{{ user }}" + mode: 0755 + +- name: "Create alacritty config" + copy: + src: './files/terminator.conf' + dest: '{{ home }}/.config/terminator/config' + mode: 0644 + owner: "{{ user }}" diff --git a/tasks/common.yml b/tasks/user.yml similarity index 75% rename from tasks/common.yml rename to tasks/user.yml index a49d229..24b1afc 100644 --- a/tasks/common.yml +++ b/tasks/user.yml @@ -10,12 +10,8 @@ - users - video - wheel + - file: state: directory path: '{{ home }}/Projects' owner: "{{ user }}" -- file: - state: directory - path: '/opt/pyenv' - owner: "{{ user }}" - group: users diff --git a/tasks/vim.yml b/tasks/vim.yml index f6f64ad..33d6606 100644 --- a/tasks/vim.yml +++ b/tasks/vim.yml @@ -1,3 +1,15 @@ +- name: "Install dev packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'gvim' + - 'vim-pathogen' + + - copy: src: ./files/vimrc dest: "{{ home }}/.vimrc" diff --git a/tasks/vscode.yml b/tasks/vscode.yml index ceb01b5..2af9e9f 100644 --- a/tasks/vscode.yml +++ b/tasks/vscode.yml @@ -1,3 +1,14 @@ +- name: "Install VSCode packages" + aur: + skip_installed: true + name: "{{ item }}" + become: true + become_user: aur_builder + when: "item not in installed_packages.stdout_lines" + with_items: + - 'community/code' + - 'universal-ctags-git' + - file: src: "{{ home }}/.config/Code - OSS" dest: "{{ home }}/.config/Code"