Compare commits

...

9 commits

19 changed files with 238 additions and 42 deletions

View file

@ -1,11 +1,11 @@
# Personal Linux Setup # Personal Linux Setup
My current setup is [Regolith OS](https://regolith-desktop.com/) which is basically Ubuntu + i3. My current setup is [Linux Mint Vera](https://linuxmint.com/edition.php?id=302) with the [i3 window manager](https://i3wm.org/).
## Before installing ## Before installing
- Put asymmetric key pair in ~/.ssh - Put Ansible Vault password in .vault_password
- Install git - Install git and curl
- Install Ansible: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html - Install Ansible: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
## TODO ## TODO
@ -29,8 +29,3 @@ As an intermediate solution, I can just put the password in keepass...
- More cool plugins :) - More cool plugins :)
- dropdown autocomplete - dropdown autocomplete
- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#yamlls - https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#yamlls
## Long-term TODO
- Move away from GNOME because it is quite slow and configuration is pretty bad. This would also mean moving away from Regolith unfortunately. I would probably move to KDE with i3. Maybe there is some distro that does this OOTB?
- Move away from systemd. Not sure how feasibly that is nowadays, but I just get annoyed by some systemd "features" such as resolved.

View file

@ -1,6 +1,8 @@
distribution_release: jammy
first_name: Pim first_name: Pim
last_name: Kunis last_name: Kunis
full_name: "{{ first_name }} {{ last_name }}" full_name: "{{ first_name }} {{ last_name }}"
email: pim@kunis.nl email: pim@kunis.nl
vscodium_extensions: vscodium_extensions:
- shd101wyy.markdown-preview-enhanced - shd101wyy.markdown-preview-enhanced
ssh_agent_socket: /tmp/ssh-agent.socket

View file

@ -3,10 +3,18 @@
roles: roles:
- role: system - role: system
tags: [system] tags: [system]
- role: i3
tags: [i3]
- role: bash - role: bash
tags: [bash] tags: [bash]
- role: alacritty - role: alacritty
tags: [alacritty] tags: [alacritty]
- role: syncthing
tags: [syncthing]
vars:
syncthing_profile: "laptop"
- role: keepassxc
tags: [keepassxc]
- role: wireguard - role: wireguard
tags: [wireguard] tags: [wireguard]
- role: asdf - role: asdf
@ -19,10 +27,6 @@
tags: [virtualbox] tags: [virtualbox]
- role: vscodium - role: vscodium
tags: [vscodium] tags: [vscodium]
- role: syncthing
tags: [syncthing]
vars:
syncthing_profile: "laptop"
- role: strawberry - role: strawberry
tags: [strawberry] tags: [strawberry]
- role: nicotine - role: nicotine

View file

@ -3,17 +3,21 @@
roles: roles:
- role: system - role: system
tags: [system] tags: [system]
- role: i3
tags: [i3]
- role: bash - role: bash
tags: [bash] tags: [bash]
- role: alacritty - role: alacritty
tags: [alacritty] tags: [alacritty]
- role: syncthing
tags: [syncthing]
vars:
syncthing_profile: "os3"
- role: keepassxc
tags: [keepassxc]
- role: neovim - role: neovim
tags: [neovim] tags: [neovim]
- role: signal - role: signal
tags: [signal] tags: [signal]
- role: vscodium - role: vscodium
tags: [vscodium] tags: [vscodium]
- role: syncthing
tags: [syncthing]
vars:
syncthing_profile: "os3"

View file

@ -7,7 +7,7 @@
- name: Install PPA repository - name: Install PPA repository
become: true become: true
apt_repository: apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/alacritty.gpg] https://ppa.launchpadcontent.net/aslatter/ppa/ubuntu {{ ansible_distribution_release }} main" repo: "deb [signed-by=/etc/apt/keyrings/alacritty.gpg] https://ppa.launchpadcontent.net/aslatter/ppa/ubuntu {{ distribution_release }} main"
register: apt_repository register: apt_repository
- name: Update APT cache - name: Update APT cache
become: true become: true

View file

@ -6,8 +6,8 @@
- bat - bat
- fzf - fzf
- name: Install .bashrc - name: Install .bashrc
copy: template:
src: "{{ role_path }}/files/bashrc" src: "{{ role_path }}/templates/bashrc.j2"
dest: ~/.bashrc dest: ~/.bashrc
- name: Install .fzf.bash - name: Install .fzf.bash
copy: copy:

View file

@ -100,3 +100,8 @@ alias vim='nvim'
# asdf # asdf
[ -f ~/.asdf/asdf.sh ] && source ~/.asdf/asdf.sh [ -f ~/.asdf/asdf.sh ] && source ~/.asdf/asdf.sh
[ -f ~/.asdf/completions/asdf.bash ] && source ~/.asdf/completions/asdf.bash [ -f ~/.asdf/completions/asdf.bash ] && source ~/.asdf/completions/asdf.bash
# pip scripts
PATH=$PATH:~/.local/bin
export SSH_AUTH_SOCK="{{ ssh_agent_socket }}"

143
roles/i3/files/config Normal file
View file

@ -0,0 +1,143 @@
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex --autostart --environment i3
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+q kill
# program picker
bindsym $mod+d exec --no-startup-id "rofi -modi drun,run -show drun"
# change focus
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+h focus left
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# toggle split direction
bindsym $mod+t split toggle
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
bindsym l resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym j resize shrink height 10 px or 10 ppt
bindsym h resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
}
focus_follows_mouse no
bindsym $mod+Escape exec i3lock

15
roles/i3/tasks/main.yml Normal file
View file

@ -0,0 +1,15 @@
- name: Install packages
become: true
apt:
pkg:
- i3-wm
- rofi
- i3lock
- name: Create i3 config directory
file:
path: ~/.config/i3
state: directory
- name: Copy i3 config
copy:
src: "{{ role_path }}/files/config"
dest: ~/.config/i3/config

View file

@ -0,0 +1,23 @@
- name: Install Keepassxc
become: true
apt:
name: keepassxc
- name: Create keepassxc config directory
file:
path: ~/.config/keepassxc
state: directory
- name: Copy keepassxc.ini
copy:
src: "{{ role_path }}/files/keepassxc.ini"
dest: ~/.config/keepassxc/keepassxc.ini
- name: Create cache directory
file:
path: ~/.cache/keepassxc
state: directory
recurse: true
- name: Set SSH_AUTH_SOCK override
ini_file:
path: ~/.cache/keepassxc/keepassxc.ini
section: SSHAgent
option: AuthSockOverride
value: "{{ ssh_agent_socket }}"

View file

@ -7,7 +7,7 @@
- name: Install Neovim PPA - name: Install Neovim PPA
become: true become: true
apt_repository: apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/neovim.gpg] https://ppa.launchpadcontent.net/neovim-ppa/unstable/ubuntu {{ ansible_distribution_release }} main" repo: "deb [signed-by=/etc/apt/keyrings/neovim.gpg] https://ppa.launchpadcontent.net/neovim-ppa/unstable/ubuntu {{ distribution_release }} main"
register: apt_repository register: apt_repository
- name: Update APT cache - name: Update APT cache
become: true become: true

View file

@ -7,7 +7,7 @@
- name: Install PPA repository - name: Install PPA repository
become: true become: true
apt_repository: apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/nicotine.gpg] https://ppa.launchpadcontent.net/nicotine-team/stable/ubuntu {{ ansible_distribution_release }} main" repo: "deb [signed-by=/etc/apt/keyrings/nicotine.gpg] https://ppa.launchpadcontent.net/nicotine-team/stable/ubuntu {{ distribution_release }} main"
register: apt_repository register: apt_repository
- name: Update APT cache - name: Update APT cache
become: true become: true

View file

@ -7,7 +7,7 @@
- name: Install PPA repository - name: Install PPA repository
become: true become: true
apt_repository: apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/strawberry.gpg] https://ppa.launchpadcontent.net/jonaski/strawberry/ubuntu {{ ansible_distribution_release }} main" repo: "deb [signed-by=/etc/apt/keyrings/strawberry.gpg] https://ppa.launchpadcontent.net/jonaski/strawberry/ubuntu {{ distribution_release }} main"
register: apt_repository register: apt_repository
- name: Update APT cache - name: Update APT cache
become: true become: true

View file

@ -1,5 +0,0 @@
i3-wm.binding.split_h: c
i3-wm.binding.launcher.app: d
i3-wm.binding.display: F1
i3-wm.binding.settings: F2

View file

@ -1,3 +1,5 @@
AddKeysToAgent yes
Host brussels Host brussels
HostName brussels.studlab.os3.nl HostName brussels.studlab.os3.nl
User pkunis User pkunis

View file

@ -4,7 +4,6 @@
pkg: pkg:
- git - git
- make - make
- keepassxc
- ripgrep - ripgrep
- curl - curl
- unzip - unzip
@ -19,18 +18,6 @@
template: template:
src: "{{ role_path }}/templates/.gitconfig.j2" src: "{{ role_path }}/templates/.gitconfig.j2"
dest: ~/.gitconfig dest: ~/.gitconfig
- name: Copy Xresources
copy:
src: "{{ role_path }}/files/Xresources"
dest: ~/.config/regolith2/Xresources
- name: Create keepassxc config directory
file:
path: ~/.config/keepassxc
state: directory
- name: Copy keepassxc.ini
copy:
src: "{{ role_path }}/files/keepassxc.ini"
dest: ~/.config/keepassxc/keepassxc.ini
- name: Create repos directory - name: Create repos directory
file: file:
path: ~/repos path: ~/repos
@ -44,7 +31,7 @@
- name: Install Hashicorp repository - name: Install Hashicorp repository
become: true become: true
apt_repository: apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/hashicorp.gpg] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main" repo: "deb [signed-by=/etc/apt/keyrings/hashicorp.gpg] https://apt.releases.hashicorp.com {{ distribution_release }} main"
register: apt_repository register: apt_repository
- name: Update APT cache - name: Update APT cache
become: true become: true
@ -61,3 +48,14 @@
src: "{{ role_path }}/files/ssh_config" src: "{{ role_path }}/files/ssh_config"
dest: ~/.ssh/config dest: ~/.ssh/config
mode: 0600 mode: 0600
- name: Copy systemd ssh-agent service
become: true
template:
src: "{{ role_path }}/templates/ssh-agent.service.j2"
dest: /etc/systemd/user/ssh-agent.service
- name: Enable ssh-agent service
systemd:
name: ssh-agent
enabled: true
scope: user
state: started

View file

@ -0,0 +1,10 @@
[Unit]
Description=SSH key agent
[Service]
Type=simple
Environment=SSH_AUTH_SOCK={{ ssh_agent_socket }}
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target

View file

@ -7,7 +7,7 @@
- name: Install VirtualBox APT repository - name: Install VirtualBox APT repository
become: true become: true
apt_repository: apt_repository:
repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/oracle_vbox_2016.asc] https://download.virtualbox.org/virtualbox/debian {{ ansible_distribution_release }} contrib" repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/oracle_vbox_2016.asc] https://download.virtualbox.org/virtualbox/debian {{ distribution_release }} contrib"
register: apt_repository register: apt_repository
tags: update tags: update
- name: Update APT cache - name: Update APT cache