My dotfiles for Arch Linux
at main 286 lines 5.4 kB view raw view rendered
1# dotfiles 2 3My dotfiles for CachyOS. 4 5## Usage 6 7### Prerequisits 8 9I use CachyOS, which is an Arch Linux based distro with some nice benefits: 10 11- Kernel and packages compiled with Zen 4 (AMD) support 12- Desktop environment selection during installation 13- Good defaults ([Alacritty](https://alacritty.org), [fish](https://fishshell.com), [paru](https://github.com/Morganamilo/paru)) 14- Many useful packages pre-installed (eza, fprintd, bat) 15 16First, install [CachyOS Desktop Edition](https://cachyos.org/download/) and select Limine as a bootloader and niri as desktop environment. 17 18### Setup 19 20I use niri as my preferred desktop environment and it comes preconfigured with CachyOS. My dotfiles are based on it, but customize some of it. 21 22#### Install additional packages 23 24My niri setup depends on the following additional packages: 25 26```bash 27paru -S \ 28 swayidle \ 29 kwallet-pam \ 30 fprintd \ 31 yazi \ 32 btop \ 33 bluetui \ 34 impala 35``` 36 37I prefer [iwd as Wifi back-end of NetworkManager](https://wiki.archlinux.org/title/NetworkManager#Using_iwd_as_the_Wi-Fi_backend). Once configured, restart the service: 38 39```bash 40sudo systemctl restart NetworkManager.service 41``` 42 43Wifi must be reconfigured now. 44 45#### Create SSH key 46 47I use my Yubikey to authorize SSH key usage. This requires `libfido2`: 48 49```bash 50paru -S libfido2 51``` 52 53Then generate a new SSH key (default location, no passphrase): 54 55```bash 56ssh-keygen -t ed25519-sk -C jan.ehrhardt@cozybytes.tech 57``` 58 59#### Setup Neovim 60 61Install the required packages: 62 63```bash 64paru -S \ 65 neovim \ 66 tree-sitter-cli 67``` 68 69I use LazyVim, which is a Neovim distro with good defaults for programming. Install it by [following the instructions](https://www.lazyvim.org/installation). 70 71#### Setup terminal 72 73Install additional packages for my terminal setup: 74 75```bash 76paru -S \ 77 starship \ 78 zellij \ 79 zoxide \ 80 atuin \ 81 mise 82``` 83 84Login to atuin and sync history: 85 86```bash 87atuin login 88atuin sync 89``` 90 91#### Setup dotfiles 92 93I use [chezmoi](https://www.chezmoi.io) to manage my dotfiles. First, install it: 94 95```bash 96paru -S chezmoi 97``` 98 99Then apply the dotfiles from my Git repo: 100 101```bash 102chezmoi init --ssh --apply git@tangled.org:jehrhardt.dev/dotfiles 103``` 104 105This will automatically configure the system. 106 107#### Ensure systemd units are enabled 108 109I use systemd to launch several services along niri. They must be enabled by: 110 111```bash 112systemctl --user add-wants niri.service plasma-polkit-agent.service 113systemctl --user add-wants niri.service mako.service 114systemctl --user add-wants niri.service waybar.service 115systemctl --user add-wants niri.service swayidle.service 116``` 117 118#### Setup fingerprint reader 119 120I prefer to use the fingerprint reader to unlock my laptop and authorize `sudo` commands in my terminal. 121 122Update PAM configuration to use fingerprint authentication. 123 124##### /etc/pam.d/sudo 125 126Add before other config: 127 128``` 129auth sufficient pam_fprintd.so 130``` 131 132##### /etc/pam.d/polkit-1 133 134Add the following: 135 136``` 137#%PAM-1.0 138auth sufficient pam_fprintd.so 139auth required pam_unix.so 140account required pam_unix.so 141password required pam_unix.so 142session required pam_unix.so 143``` 144 145##### /etc/pam.d/swaylock 146 147Add before other config: 148 149``` 150auth sufficient pam_unix.so try_first_pass likeauth nullok 151auth sufficient pam_fprintd.so 152``` 153 154##### Add new fingerprint 155 156Restart polkit agent: 157 158```bash 159systemctl --user restart plasma-polkit-agent.service 160``` 161 162Enroll: 163 164```bash 165fprintd-enroll 166``` 167 168Then verify: 169 170```bash 171fprintd-verify 172``` 173 174#### Install development tools 175 176I use several tools for development that are not configured via my dotfiles, but need to be setup. 177 178##### OpenCode 179 180I use OpenCode as my preferred coding agent. Some of the reasons: 181 182- Nice TUI 183- Supports different models and providers 184- It works really well 185 186Install it: 187 188```bash 189paru -S opencode-bin 190``` 191 192##### Docker and Supabase CLI 193 194Supabase CLI uses Docker to run locally. This is nice for development. 195 196Install required packages: 197 198```bash 199paru -S \ 200 supabase-bin \ 201 lazydocker \ 202 docker \ 203 docker-buildx \ 204 docker-compose 205``` 206 207Enable Docker service: 208 209```bash 210sudo systemctl enable docker.service 211``` 212 213Give yourself permission to access Docker daemon: 214 215```bash 216sudo usermod -aG docker $USER 217``` 218 219##### Rust 220 221I use [mise](https://mise.jdx.dev) to setup development environments including programming languages. Rust is the only exception as I prefer [rustup](https://rustup.rs). 222 223It can be installed as a package: 224 225```bash 226paru -S rustup 227``` 228 229I use stable toolchain: 230 231```bash 232rustup install stable 233``` 234 235##### Python via `uv` 236 237I vibe code Python for automation and experimentation and my preferred way to handle it is `uv`. 238 239Install it via mise: 240 241```bash 242mise use --global uv 243``` 244 245Then install completions: 246 247```bash 248echo 'uv generate-shell-completion fish | source' > ~/.config/fish/completions/uv.fish 249echo 'uvx --generate-shell-completion fish | source' > ~/.config/fish/completions/uvx.fish 250``` 251 252##### Node.js 253 254Plenty of tools (e.g. language servers used by Neovim) require Node.js to present. 255 256Install LTS version via mise: 257 258```bash 259mise use --global node@lts 260``` 261 262#### Install other apps 263 264##### OpenCode 265 266My preferred coding agent: 267 268```bash 269paru -S opencode-bin 270``` 271 272##### Brave 273 274My preferred browser. It uses KWallet for storing passwords (requires wallet password to match user password). 275 276```bash 277paru -S brave-bin 278``` 279 280##### Obsidian 281 282My preferred note taking app: 283 284```bash 285paru -S obsidian-bin 286```