Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d376c7b
Add bash function to set volume
pewing-blz Jul 17, 2024
7bccac3
Add shell indicator to wezterm titles
pcewing Jul 17, 2024
de061f4
Add Neovim command for closing tabs
pcewing Jul 19, 2024
a2b2fe0
Add xp todo
pcewing Jul 22, 2024
f9da930
Improve neovim tabline
pcewing Aug 3, 2024
a2247a4
CLI Windows support stuff
pcewing Aug 3, 2024
e5f5be3
[Auto] Syncing local changes with remote
pcewing Aug 9, 2024
ea5731b
Add git-bash alias/function
pcewing Aug 14, 2024
a6fef43
Improve Neovim tabline
pcewing Aug 14, 2024
23bf5d2
Create default fd config file
pcewing Aug 27, 2024
852abda
Update logging to use dicts
pcewing Aug 29, 2024
7bc8984
[Auto] Syncing local changes with remote
pcewing Oct 3, 2024
225c55d
Updates
pcewing Oct 4, 2024
6538663
Updates
pcewing Oct 5, 2024
3479dc2
[Auto] Syncing local changes with remote
pcewing Oct 7, 2024
df3a879
[Auto] Syncing local changes with remote
pcewing Oct 13, 2024
334b0d7
Updates
pcewing Oct 15, 2024
4275a09
Add LaTeX snippets
pcewing Nov 18, 2024
ca46238
Updates
pcewing Nov 18, 2024
0f965cc
Format Python files
pcewing Nov 18, 2024
50ffe9d
Make invalid regexes easier to identify
pcewing Nov 18, 2024
4bdcb80
Improve git pending changes script
pcewing Dec 21, 2024
44ca224
Updates
pcewing Jan 15, 2025
c1816ab
Fix neovim provisioner
pcewing Feb 5, 2025
30fd264
Updates
pewing-blz Mar 4, 2025
0beb2e7
Add nautilus path note to TODO
pcewing Mar 16, 2025
4b95100
Updates
pcewing May 27, 2025
eb04202
Fix logging statement in CLI
pcewing Jul 11, 2025
56ff615
Add override for WSL Wezterm domain name
pcewing Jul 11, 2025
f7ddcc5
Add merge_pdfs bash function
pcewing Jul 31, 2025
0291ec7
Update TODO list
pcewing Aug 27, 2025
dcf9c53
base16 flavours scp workaround
pcewing Nov 20, 2025
a09dbc3
Proper fix for base16 scp issue
pcewing Nov 20, 2025
22d86b4
Add jpg_to_png function
pcewing Dec 15, 2025
598a041
Provisioner script updates
pcewing Dec 15, 2025
ca50aaa
Env file improvements
pcewing Jan 1, 2026
c6ea145
Nix Home Manager (#7)
pcewing Jan 5, 2026
9f05671
AI recommended improvements
pcewing Jan 5, 2026
de81313
Clean up suggestions in apply.sh
pcewing Jan 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ gitconfig_local
*.zwc
*.swp
*.pyc
version_cache.json5
82 changes: 82 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This is a dotfiles management system for Linux environments using Nix and Home Manager for declarative configuration. It supports multiple host types: desktops, servers, and WSL instances.

## Common Commands

### Fresh Install (Primary Method)
```bash
./apply.sh --nix-host <host-name>
# Example: ./apply.sh --nix-host personal-desktop
```
Available hosts are defined in `nix/hosts.json`: personal-desktop, work-desktop, personal-wsl, work-wsl, personal-server, work-server.

### Apply Nix Configuration Changes
```bash
home-manager switch --flake ~/dot/nix#<host-name>
```

### Python CLI Tool
```bash
dot provision [TAGS] # Run provisioners
dot link # Create symlinks (legacy)
dot clean # Remove symlinks
dot tidy # Format Python code (black, isort, autoflake)
```

### Type Checking and Linting
```bash
make mypy # Run mypy on all Python files
```

### Theming
```bash
set-theme <scheme-name> # Apply base16 color scheme (e.g., outrun-dark)
flavours update all # Required first time setup
```

## Architecture

### Nix Configuration (`nix/`)
- `flake.nix` - Entry point; generates Home Manager configurations from `hosts.json`
- `hosts.json` - Defines hosts and their roles (core, desktop, gaming, wsl)
- `home/roles/` - Host-type configurations (Ansible-style naming):
- `core.nix` - Base packages (neovim, git, fzf, tmux, Python tools)
- `desktop.nix` - GUI packages (i3, kitty, rofi, mpd, media tools)
- `gaming.nix` - Gaming packages
- `wsl.nix` - WSL-specific configuration
- `home/lib/` - Shared modules imported by roles:
- `dotfiles-links.nix` - Maps config files from `config/` to home directory
- `python-environment.nix` - Builds unified Python environment
- `home/features/` - Specific feature modules (e.g., docker) that can be shared across roles

### Configuration Files (`config/`)
Application configs that get linked to home directory via Home Manager:
- `bash/` - Shell configuration
- `nvim/` - Neovim configuration
- `i3`, `sway` - Window manager configs
- `kitty.conf`, `alacritty/`, `wezterm.lua` - Terminal emulators
- `flavours/` - Base16 theming (schemes in `schemes/custom/`, templates in `templates/custom/`)

### Python CLI (`cli/`)
- `dot.py` - Main entry point with argparse
- `commands/` - Command implementations (provision, link, tidy, lint, etc.)
- `lib/provision/` - Provisioners for apt, pip, nodejs, docker, neovim, etc.
- `lib/common/` - Shared utilities (shell, git, logging, file operations)

### Utility Scripts (`bin/`)
Standalone scripts: `set-theme`, `i3-util.sh`, `startup.sh`, `fuzzy-fm`, etc.

## Key Files

- `apply.sh` - Bootstrap script for fresh installs (installs Nix, applies Home Manager)
- `links.json` - Legacy dotfile symlink mappings (now mostly handled by `dotfiles-links.nix`)
- `nix/hosts.json` - Host definitions with roles; drives the entire Nix configuration

## Code Style

Python code uses black, isort, and autoflake. Run `dot tidy` before committing Python changes. Type hints are encouraged; validate with `make mypy`.
82 changes: 82 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# GEMINI.md

This file provides guidance to Gemini when working with code in this repository.

## Project Overview

This is a dotfiles management system for Linux environments using Nix and Home Manager for declarative configuration. It supports multiple host types: desktops, servers, and WSL instances.

## Common Commands

### Fresh Install (Primary Method)
```bash
./apply.sh --nix-host <host-name>
# Example: ./apply.sh --nix-host personal-desktop
```
Available hosts are defined in `nix/hosts.json`: personal-desktop, work-desktop, personal-wsl, work-wsl, personal-server, work-server.

### Apply Nix Configuration Changes
```bash
home-manager switch --flake ~/dot/nix#<host-name>
```

### Python CLI Tool
```bash
dot provision [TAGS] # Run provisioners
dot link # Create symlinks (legacy)
dot clean # Remove symlinks
dot tidy # Format Python code (black, isort, autoflake)
```

### Type Checking and Linting
```bash
make mypy # Run mypy on all Python files
```

### Theming
```bash
set-theme <scheme-name> # Apply base16 color scheme (e.g., outrun-dark)
flavours update all # Required first time setup
```

## Architecture

### Nix Configuration (`nix/`)
- `flake.nix` - Entry point; generates Home Manager configurations from `hosts.json`
- `hosts.json` - Defines hosts and their roles (core, desktop, gaming, wsl)
- `home/roles/` - Host-type configurations (Ansible-style naming):
- `core.nix` - Base packages (neovim, git, fzf, tmux, Python tools)
- `desktop.nix` - GUI packages (i3, kitty, rofi, mpd, media tools)
- `gaming.nix` - Gaming packages
- `wsl.nix` - WSL-specific configuration
- `home/lib/` - Shared modules imported by roles:
- `dotfiles-links.nix` - Maps config files from `config/` to home directory
- `python-environment.nix` - Builds unified Python environment
- `home/features/` - Specific feature modules (e.g., docker) that can be shared across roles

### Configuration Files (`config/`)
Application configs that get linked to home directory via Home Manager:
- `bash/` - Shell configuration
- `nvim/` - Neovim configuration
- `i3`, `sway` - Window manager configs
- `kitty.conf`, `alacritty/`, `wezterm.lua` - Terminal emulators
- `flavours/` - Base16 theming (schemes in `schemes/custom/`, templates in `templates/custom/`)

### Python CLI (`cli/`)
- `dot.py` - Main entry point with argparse
- `commands/` - Command implementations (provision, link, tidy, lint, etc.)
- `lib/provision/` - Provisioners for apt, pip, nodejs, docker, neovim, etc.
- `lib/common/` - Shared utilities (shell, git, logging, file operations)

### Utility Scripts (`bin/`)
Standalone scripts: `set-theme`, `i3-util.sh`, `startup.sh`, `fuzzy-fm`, etc.

## Key Files

- `apply.sh` - Bootstrap script for fresh installs (installs Nix, applies Home Manager)
- `links.json` - Legacy dotfile symlink mappings (now mostly handled by `dotfiles-links.nix`)
- `nix/hosts.json` - Host definitions with roles; drives the entire Nix configuration

## Code Style

Python code uses black, isort, and autoflake. Run `dot tidy` before committing Python changes. Type hints are encouraged; validate with `make mypy`.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ windows:
mypy:
find . -iname '*.py' | xargs mypy --config-file ./mypy.ini
mypy --config-file ./mypy.ini ./bin/fzf_cached_wsl

# Run nixfmt on all Nix files
.PHONY: nixfmt
nixfmt:
# Run this in a nix-shell so we can get the most up-to-date version of
# nixfmt since the --indent option was added fairly recently.
nix-shell -p nixfmt --run "find . -iname '*.nix' | xargs nixfmt --indent=4"
158 changes: 11 additions & 147 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,154 +1,18 @@
# Dotfiles

This repository contains my dotfiles!
This repository contains my dotfiles and uses Nix and Home Manager for
declarative configuration across my machines.

## Manual Setup
## Getting Started

A few things I haven't bothered to automate.
- **Ubuntu Setup Instructions:**
- [setup_ubuntu.md](./doc/setup_ubuntu.md)
- **Windows Setup Instructions:**
- [setup_windows.md](./doc/setup_windows.md)

### Git
## Theme

Create `~/.gitconfig_local` like:
For details on how theming is set up and how to modify a theme or change the
current theme, see:

```
[user]
email = paul@foo.com
name = Paul Ewing
```

### Wallpaper Rotater

If using `wpr`, create `~/.config/wpr/config.json` like:

```json
{
"WallpaperDir": "/home/username/Pictures/Wallpapers",
"DisplayCount": 1,
"Interval":120
}
```

### Dual Boot Clock Fix

If dual booting with Windows, set hardware clock to local time:

```bash
timedatectl set-local-rtc 1
```

Without this, clock time in Windows will be off.

### Applications to Manually Install

The following aren't in apt and need to be installed manually:

- Chrome
- Beyond Compare
- Insync
- Discord
- RuneLite

Alacritty is not yet in the default Ubuntu apt repositories:

```bash
sudo add-apt-repository ppa:mmstick76/alacritty
sudo apt update
```

## Theming

To make it easier to re-theme everything at once, I use
[base16](https://github.com/chriskempson/base16) and
[flavours](https://github.com/Misterio77/flavours). See:

The tl;dr of `base16` is that it is a system for designing color schemes.
`base16` schemes consists of a palette of 16 colors - 8 shades and 8 accents.
Templates can then be created to render the base16 scheme into various config
formats for different applications.

Due to some [turbulence](https://github.com/tinted-theming/home/issues/51) in
the `base16` project, I've added my most used schemes directly to my dotfiles
to avoid things breaking if repositories are ever moved or taken down. I've
also created my own templates rather than using the defaults.

- [schemes](./config/flavours/schemes/custom)
- [templates](./config/flavours/templates/custom/templates)

Using the `flavours` application, these templates are rendered directly into my
dotfiles based on the `flavours` config:

- [flavours/config.toml](./config/flavours/config.toml)

To apply a new color scheme, download and install
[flavours](https://github.com/Misterio77/flavours/releases/latest).

The first time running, update sources. Even if using schemes/templates
committed to my dotfiles, this still appears to be necessary:

```bash
flavours update all
```

**Note:** We should add flavours installation to the provision script.

Once flavours is installed, set the theme using the
[set-theme](./bin/set-theme) script. This not only executes `flavours` but also
reloads config across various applications to smoothly transition themes.

```bash
set-theme <theme-name>
```

The name should match the corresponding base16 scheme yaml file without the
extension. For example:

```bash
flavours apply outrun-dark
```

The official lists of templates and schemes supported by flavours live here:

- https://github.com/chriskempson/base16-schemes-source/blob/main/list.yaml
- https://github.com/chriskempson/base16-templates-source/blob/master/list.yaml

Manual steps after changing themes:

- Reload tmux config
- `:source-file ~/.tmux.conf`
- We should figure out how to automate this

### TODO

Some remaining items to tackle in regards to theming:
- Add templates for
- sway

## Windows 10

For setup steps on Windows 10, see:

[windows_setup.md](./windows_setup.md)

### WSL

Some useful things to add to `.localrc` in WSL.

Remove the background highlighting of folders in ls:

```bash
LS_COLORS=$LS_COLORS:'ow=1;34:' ; export LS_COLORS
```

WezTerm shell integration; this adds some useful features like having new tabs
open in the same directory as the previous:
```
if [ "$TERM_PROGRAM" = "WezTerm" ] && [ -f "$HOME/wezterm.sh" ]; then
source "$HOME/wezterm.sh"
fi
```

For now just manually create and copy the `wezterm.sh` file from here:

https://raw.githubusercontent.com/wez/wezterm/main/assets/shell-integration/wezterm.sh

We could make this a bit nicer by automatically downloading it.
[theme.md](./doc/theme.md)
Loading