ansible playbook + fix waybar config

This commit is contained in:
yourfriendoss 2023-10-15 12:34:55 +03:00
parent c6d0002178
commit f649479e1b
2 changed files with 174 additions and 2 deletions

172
play.yml Normal file
View file

@ -0,0 +1,172 @@
#⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠄⠀⠀⠀⠀⡠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
#⠀⣀⣠⡤⣀⣀⡀⠀⠀⠀⠑⡀⠈⠂⡠⣠⠊⠀⢀⠜⠀⠀⠀⠀⣀⣀⠀⠀⠀
#⠈⢿⣭⡍⠩⠉⠄⢛⡲⠤⣀⠸⣄⣿⣿⣿⣷⣴⣡⠤⣒⠩⠝⢩⡙⠫⠝⠛⣶
#⠀⠀⠉⢖⠒⠒⠒⠀⠐⠚⠷⣺⣇⠀⠀⠀⠋⣿⠿⣗⣀⡉⠉⠩⣭⣤⣽⠿⠋
#⠀⠀⠀⠈⠓⠠⠤⠬⠷⠖⢋⡽⣿⣷⢄⣸⣼⣿⣍⠓⠥⢍⣶⣤⡍⠔⠂⠀⠀
#⠀⠀⠀⠀⠀⠀⠀⠀⠀⡴⢩⣾⣿⣛⢟⠿⢿⣷⡌⠱⡄⠀⠀⠀⠀⠀⠀⠀⠀
#⠀⠀⠀⠀⠀⠀⠀⠂⠉⠰⡟⣯⣍⠙⠛⠛⢛⣿⣗⡄⠈⠀⠃⠀⠀⠀⠀⠀⠀
#⠀⠀⠀⠀⠀⠀⠀⠀⠀⠿⠁⣯⣙⠛⠿⠟⢻⣿⠛⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀
#⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠀⠘⢿⡻⠿⠾⣻⠏⠀⡅⠀⠀⠀⠀⠀⠀⠀⠀⠀
#⠀⠀⠀⠀⠀⠀⠀⠀⠀⠜⠀⠀⠀⠉⠙⠋⠁⠀⠀⠘⠂⠀⠀⠀⠀⠀⠀⠀⠀
# This file should be distributed elsewhere.
# Once you're in your arch system (with networking!), `wget` this file and run
# ansible-galaxy collection install community.general
# ansible-galaxy collection install kewlfft.aur
# ansible-playbook -K play.yml
- name: Install My System (holy shit!)
hosts: localhost
tasks:
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
- name: Create user group
ansible.builtin.group:
name: yf
state: present
become: yes
- name: Create user
ansible.builtin.user:
name: yf
create_home: yes
groups: yf
append: yes
state: present
become: yes
- name: Install sudo
community.general.pacman:
name:
- sudo
state: present
become: yes
- name: Give user yf max sudoers
community.general.sudoers:
name: main-user
state: present
user: yf
runas: ALL
commands: ALL
become: yes
- name: Install yay using makepkg if it isn't installed already
kewlfft.aur.aur:
name: yay
use: makepkg
state: present
become: yes
become_user: yf
- name: Creates getty autologin service folder
ansible.builtin.file:
path: /etc/systemd/system/getty@tty1.service.d
state: directory
become: yes
- name: Insert block in getty config
ansible.builtin.blockinfile:
path: /etc/systemd/system/getty@tty1.service.d/skip-username.conf
block: |
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -- yf' --noclear --skip-login - $TERM
Environment=XDG_SESSION_TYPE=wayland
become: yes
- name: Enable getty@tty1
ansible.builtin.systemd:
name: getty@tty1
enabled: true
become: yes
- name: Remove password of yf
user: name=yf password=''
become: yes
- name: Install stow
community.general.pacman:
name:
- stow
state: present
become: yes
- name: Clone my dotfiles
ansible.builtin.git:
repo: 'https://github.com/yourfriendoss/dots.git'
dest: /home/yf/.shell
become: yes
become_user: yf
- name: Upgrade the system using yay
kewlfft.aur.aur:
upgrade: yes
use: yay
become: yes
become_user: yf
- name: Run stow
ansible.builtin.shell: "stow . --target=/home/yf/ --verbose=2"
args:
chdir: /home/yf/.shell/src
register: result
changed_when: 'result.stderr is search("LINK: ")'
become: yes
become_user: yf
- name: Install dropbox GPG key
ansible.builtin.shell: curl -sSL https://linux.dropbox.com/fedora/rpm-public-key.asc | gpg --import
register: result
changed_when: 'result.stderr is search("imported")'
become: yes
- name: Install everything!
kewlfft.aur.aur:
use: yay
name:
- python-gpgme
- pkgconfig
- patch
- flex
- bison
- which
- pipewire
- wireplumber
- pipewire-pulse
- pipewire-alsa
- pipewire-jack
- qpwgraph
- hyprland
- xdg-desktop-portal-hyprland-git
- polkit-kde-agent
- waybar-hyprland-git
- alacritty
- wl-clipboard
- slurp
- grim
- rofi-lbonn-wayland-git
- mako
- swww
- thunar
- gvfs
- gvfs-smb
- dropbox
- thunar-dropbox
- dropbox-cli
- spotify
- spicetify-cli
- ttf-jetbrains-mono-nerd
- discord
- vivaldi
- wps-office
- ttf-wps-fonts
- visual-studio-code-bin
state: present
extra_args: "--needed"
become: yes
become_user: yf
- name: Create .bash_profile
ansible.builtin.file:
path: /home/yf/.bash_profile
state: touch
become: yes
become_user: yf
- name: Write auto-hyprland login
ansible.builtin.blockinfile:
path: /home/yf/.bash_profile
block: |
if [[ "$(tty)" == "/dev/tty1" ]]
then
Hyprland
fi
become: yes
become_user: yf

View file

@ -2,13 +2,13 @@
"layer": "top", "layer": "top",
"height": 30, "height": 30,
"spacing": 4, "spacing": 4,
"modules-left": ["wlr/workspaces", "custom/media"], "modules-left": ["hyprland/workspaces", "custom/media"],
"modules-right": [ "modules-right": [
"pulseaudio", "pulseaudio",
"clock", "clock",
"tray" "tray"
], ],
"wlr/workspaces": { "hyprland/workspaces": {
"format": "{icon}", "format": "{icon}",
"on-scroll-up": "hyprctl dispatch workspace e+1", "on-scroll-up": "hyprctl dispatch workspace e+1",
"on-scroll-down": "hyprctl dispatch workspace e-1", "on-scroll-down": "hyprctl dispatch workspace e-1",