Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
124 changes: 124 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
run: |
for f in install.sh uninstall.sh lib/*.sh linux/*.sh linux/debian/*.sh macos/*.sh; do bash -n "$f"; done
jq . config/caelestia/shell.json >/dev/null
jq . config/windows-terminal/dotfiles.json >/dev/null
for f in config/nvim/dotfiles.lua config/caelestia/*.lua; do luac5.4 -p "$f" 2>&1 || lua5.4 -e "assert(loadfile('$f'))"; done
- name: Menu (scripted answers)
run: tests/menu.sh
Expand Down Expand Up @@ -56,3 +57,126 @@ jobs:
zsh -ic 'echo zsh loads the config: $STARSHIP_CONFIG'
/bin/bash "$GITHUB_WORKSPACE/uninstall.sh" --yes
test ! -e "$HOME/.zshrc"

# Windows: the checks run under both Windows PowerShell 5.1 (what every Windows has) and PowerShell 7.
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Parse, ASCII and menu checks (Windows PowerShell 5.1)
shell: powershell
run: powershell -NoProfile -ExecutionPolicy Bypass -File tests\windows.ps1
- name: Parse, ASCII and menu checks (PowerShell 7)
shell: pwsh
run: pwsh -NoProfile -File tests\windows.ps1
- name: PSScriptAnalyzer (errors)
shell: pwsh
run: |
Install-Module PSScriptAnalyzer -Force -Scope CurrentUser
$r = Invoke-ScriptAnalyzer -Path . -Recurse -Severity Error
$r | Format-Table -AutoSize
if ($r) { exit 1 }
- name: Dry run of every Windows component (through the entry script)
shell: powershell
run: powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -DryRun -Yes -All
- name: winget on the runner
shell: pwsh
run: |
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
Install-Module Microsoft.WinGet.Client -Force -Scope CurrentUser
Repair-WinGetPackageManager -AllUsers -Latest
}
winget --version
- name: Real run of shell and terminal in a throw-away home, then uninstall
shell: powershell
run: |
$t = Join-Path $env:RUNNER_TEMP 'home'
$env:DOTFILES_HOME = $t; $env:DOTFILES_DOCUMENTS = "$t\Documents"; $env:DOTFILES_LOCALAPPDATA = "$t\AppData\Local"
# a Windows Terminal settings.json with comments, as Terminal writes it: only defaultProfile may change
$wt = "$t\AppData\Local\Microsoft\Windows Terminal"; New-Item -ItemType Directory -Force $wt | Out-Null
$orig = "{`n // keep me`n `"defaultProfile`": `"{61c54bbd-c2c6-5271-96e7-009a87ff44bf}`",`n `"profiles`": { `"list`": [] }`n}`n"
[IO.File]::WriteAllText("$wt\settings.json", $orig)
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Yes -Only shell,terminal
if ($LASTEXITCODE -ne 0) { throw "install failed: $LASTEXITCODE" }
$p7 = "$t\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"; $p5 = "$t\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1"
foreach ($f in $p7, $p5, "$t\.config\starship.toml", "$t\AppData\Local\Microsoft\Windows Terminal\Fragments\rhmatzeka-dotfile\dotfiles.json") {
if (-not (Test-Path $f)) { throw "missing: $f" }; Write-Host "present: $f"
}
# the profile loads in both PowerShells and gives the starship prompt
$env:Path = [Environment]::GetEnvironmentVariable('Path', 'Machine') + ';' + [Environment]::GetEnvironmentVariable('Path', 'User')
pwsh -NoProfile -Command ". '$p7'; if (-not (Get-Command starship -ErrorAction SilentlyContinue)) { exit 3 }; prompt | Out-Null; 'pwsh profile ok'"
if ($LASTEXITCODE -ne 0) { throw "pwsh profile failed: $LASTEXITCODE" }
powershell -NoProfile -ExecutionPolicy Bypass -Command ". '$p5'; prompt | Out-Null; 'powershell 5.1 profile ok'"
if ($LASTEXITCODE -ne 0) { throw "5.1 profile failed: $LASTEXITCODE" }
$now = [IO.File]::ReadAllText("$wt\settings.json")
if ($now -ne $orig.Replace('{61c54bbd-c2c6-5271-96e7-009a87ff44bf}', '{8af80b22-81dc-5325-91bc-4b9b947457a5}')) { throw "settings.json changed more than defaultProfile:`n$now" }
'default profile set, comments kept'
powershell -NoProfile -ExecutionPolicy Bypass -File .\uninstall.ps1 -Yes
if (Test-Path $p7) { throw "uninstall left $p7" }
if ([IO.File]::ReadAllText("$wt\settings.json") -ne $orig) { throw 'uninstall did not put defaultProfile back' }
'uninstall ok'

# Windows, the heavy part: Neovim with NvChad, a C compiler, tree-sitter parsers and Mason, for real (10-20 minutes).
windows-nvim:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: winget on the runner
shell: pwsh
run: |
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
Install-Module Microsoft.WinGet.Client -Force -Scope CurrentUser
Repair-WinGetPackageManager -AllUsers -Latest
}
winget --version
- name: Real run of nvim
shell: powershell
run: |
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Yes -Only nvim
if ($LASTEXITCODE -ne 0) { throw "install failed: $LASTEXITCODE" }
- name: Parsers and LSP servers are there
shell: pwsh
run: |
$env:Path = [Environment]::GetEnvironmentVariable('Path', 'Machine') + ';' + [Environment]::GetEnvironmentVariable('Path', 'User')
$data = "$env:LOCALAPPDATA\nvim-data"
Get-ChildItem "$data\site\parser" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name
foreach ($p in 'lua', 'php', 'html', 'javascript') {
if (-not (Get-ChildItem "$data\site\parser" -Filter "$p.*" -ErrorAction SilentlyContinue)) { throw "parser missing: $p" }
}
Get-ChildItem "$data\mason\packages" | Select-Object -ExpandProperty Name
foreach ($m in (Get-Content config\nvim\mason-packages | Where-Object { $_ })) {
if (-not (Test-Path "$data\mason\packages\$m")) {
Get-ChildItem $data -Filter 'mason*.log' -Recurse -ErrorAction SilentlyContinue | ForEach-Object { Get-Content $_.FullName -Tail 40 }
throw "Mason package missing: $m"
}
}
nvim --headless "+lua print(vim.treesitter.language.add('php') and 'php parser loads' or 'no php')" +qa

# Windows: the web tools for real (PHP + php.ini, Composer, MariaDB service, phpMyAdmin).
windows-web:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Real run of web
shell: powershell
run: |
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Yes -Only web
if ($LASTEXITCODE -ne 0) { throw "install failed: $LASTEXITCODE" }
- name: PHP extensions, Composer, MariaDB
shell: pwsh
run: |
$env:Path = [Environment]::GetEnvironmentVariable('Path', 'Machine') + ';' + [Environment]::GetEnvironmentVariable('Path', 'User')
$php = (Get-ChildItem "$env:LOCALAPPDATA\Microsoft\WinGet\Packages" -Directory -Filter 'PHP.PHP.8.5_*' | Select-Object -First 1).FullName + '\php.exe'
& $php -v
$mods = & $php -m
foreach ($e in 'curl', 'mbstring', 'mysqli', 'openssl', 'pdo_mysql', 'zip') { if ($mods -notcontains $e) { throw "php extension missing: $e" } }
& $php "$env:USERPROFILE\.local\bin\composer.phar" --version
if ($LASTEXITCODE -ne 0) { throw 'composer does not run' }
Get-Service *maria*, *mysql* -ErrorAction SilentlyContinue | Format-Table Name, Status, StartType
$svc = Get-Service MariaDB
"MariaDB service: $($svc.Status), $($svc.StartType)"
if ($svc.StartType -ne 'Manual') { throw 'MariaDB should start by hand (the default answer is no)' }
Start-Service MariaDB
mariadb -u root -e "SELECT VERSION();"
if ($LASTEXITCODE -ne 0) { throw 'mariadb login failed' }
if (-not (Test-Path "$env:LOCALAPPDATA\rhmatzeka-dotfile-tools\phpmyadmin\index.php")) { throw 'phpMyAdmin missing' }
58 changes: 55 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dotfiles for Linux (Debian, Ubuntu, Arch, Fedora, openSUSE) and macOS: zsh, tmux, Neovim, Ghostty and Hyprland in one command
# Dotfiles for Linux (Debian, Ubuntu, Arch, Fedora, openSUSE), macOS and Windows: zsh, tmux, Neovim, Ghostty and Hyprland in one command

[![ci](https://github.com/rhmatzeka/dotfile/actions/workflows/ci.yml/badge.svg)](https://github.com/rhmatzeka/dotfile/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/github/license/rhmatzeka/dotfile)](LICENSE)
Expand All @@ -8,9 +8,10 @@
![Fedora 44](https://img.shields.io/badge/Fedora-44-51A2DA?logo=fedora&logoColor=white)
![openSUSE Tumbleweed](https://img.shields.io/badge/openSUSE-Tumbleweed-73BA25?logo=opensuse&logoColor=white)
![macOS beta](https://img.shields.io/badge/macOS-beta-000000?logo=apple&logoColor=white)
![Windows beta](https://img.shields.io/badge/Windows-beta-0078D4?logo=windows&logoColor=white)

A one-command **dotfiles installer** for Linux (Debian/Ubuntu, Arch, Fedora, openSUSE) and **macOS** (beta) for a fast
terminal and, on Linux, an optional **Hyprland** desktop with the **Caelestia** shell. A checklist lets you pick only the
A one-command **dotfiles installer** for Linux (Debian/Ubuntu, Arch, Fedora, openSUSE), **macOS** (beta) and
**Windows** (beta, [PowerShell + Windows Terminal](#windows)) for a fast terminal and, on Linux, an optional **Hyprland** desktop with the **Caelestia** shell. A checklist lets you pick only the
parts you want, for example just the terminal setup on a Mac. It sets up **zsh** (Oh My Zsh, starship), **tmux**, **Neovim** with **NvChad** (tree-sitter, LSP),
**Ghostty**, terminal browsers (Browsh, elinks, w3m) and a Dracula + cyan theme. Nothing is overwritten without a
backup, and everything can be undone.
Expand All @@ -19,6 +20,12 @@ backup, and everything can be undone.
bash <(curl -fsSL https://dotfiles.rahmateka.my.id)
```

On Windows, in PowerShell:

```powershell
irm https://raw.githubusercontent.com/rhmatzeka/dotfile/main/install.ps1 | iex
```

## Preview

<table>
Expand Down Expand Up @@ -133,6 +140,50 @@ shows up on the other machine after the next install (or `git pull` in `~/.local

Your SSH keys, `.env` files and app logins are not part of this repository; copy them over yourself.

## Windows

Windows has no zsh, tmux or Ghostty, so the Windows installer (beta) sets up the closest native equivalents with the
same look: **PowerShell** gets the same starship prompt, aliases and fzf keys as the zshrc, and **Windows Terminal**
gets the Ghostty colours, font, padding and cursor. Neovim, Rust and the web tools are the same as everywhere else.
Packages come from **winget**, which Windows 10 (1809 or newer) and 11 already have. The desktop parts (Hyprland,
Caelestia) and the Linux-only tools are listed but cannot be picked.

Open **PowerShell** (a normal window, not as administrator) and run:

```powershell
irm https://raw.githubusercontent.com/rhmatzeka/dotfile/main/install.ps1 | iex
```

To pass options, wrap it in a script block:

```powershell
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/rhmatzeka/dotfile/main/install.ps1))) -DryRun -All
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/rhmatzeka/dotfile/main/install.ps1))) -Only shell,terminal
```

It installs git with winget if needed, fetches this repository to `%LOCALAPPDATA%\rhmatzeka-dotfile` and shows the same
checklist as on Linux and macOS (`-All`, `-Only`, `-DryRun`, `-Yes`, `-List` work like their `--` versions).

| Part | On Windows |
|---|---|
| `base` | winget: git, ripgrep, fzf, jq, PowerShell 7, the JetBrainsMono Nerd Font; eza, zoxide, fastfetch and btop4win when available |
| `shell` | starship, and one PowerShell profile linked to both PowerShell 7 and Windows PowerShell 5.1: starship prompt, PSReadLine history suggestions and Dracula colours, fzf on **Ctrl+R** (history), **Ctrl+T** (files) and **Alt+C** (folders), zoxide (`z`), eza for `ls`/`ll`/`la`, `n` for nvim, and the git shortcuts `g ga gst gd gco gb glog`. If Windows PowerShell would refuse to run the profile (the default `Restricted` script policy), it offers `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`. Local tweaks go in `~\.config\powershell\local.ps1` |
| `nvim` | Neovim, Node.js, the tree-sitter CLI and NvChad in `%LOCALAPPDATA%\nvim`, with the same parsers and Mason servers. The parsers need a C compiler: if there is no Visual Studio, GCC from WinLibs is installed (about 1 GB) |
| `terminal` | Windows Terminal (when missing) and a **profile "dotfiles (PowerShell)"** with the colour scheme, added as a [JSON fragment](https://learn.microsoft.com/windows/terminal/json-fragment-extensions) so your `settings.json` is not rewritten. It offers to make it the default profile (one value in `settings.json` changes; `uninstall` puts it back) |
| `web` | PHP 8.5 (with a `php.ini` that turns on openssl, curl, mbstring, mysqli, pdo_mysql, zip), Composer (checked against its SHA-256), MariaDB and phpMyAdmin. MariaDB is a Windows service: it asks whether it should start with Windows (default no) |
| `rust` | The official `rustup-init.exe`. Without Visual Studio it uses the GNU toolchain, which needs nothing else; it offers the Visual Studio Build Tools (about 5 GB) for the MSVC toolchain instead |
| `tmux`, `browsers`, `desktop`, `apps` | not on Windows (use Windows Terminal panes: Alt+Shift+D splits, Alt+arrows moves) |

For the real zsh/tmux setup on Windows, install **WSL** (`wsl --install`), open Ubuntu and run the Linux command inside it.

Files are linked to the repository when Windows allows symbolic links (**Developer Mode** on, or an administrator
window); otherwise they are copied, and running the installer again after a `git pull` refreshes the copies. Undo
everything with:

```powershell
irm https://raw.githubusercontent.com/rhmatzeka/dotfile/main/uninstall.ps1 | iex
```

## What you get

| Component | Contents |
Expand Down Expand Up @@ -191,6 +242,7 @@ If RAM is tight:
| Fedora 44 (and RHEL-likes via `ID_LIKE`) | Installed and checked from scratch in the official Fedora container image. `starship` is not in the Fedora repositories: its official installer is used. Only Fedora itself was tested. `web` and `rust` also installed and checked from scratch |
| openSUSE Tumbleweed | Installed and checked from scratch in the official Tumbleweed image. Leap and SLE were not tested. `web` and `rust` also installed and checked from scratch |
| macOS 13 or newer (Apple Silicon and Intel) | **Beta.** Everything except `desktop` and `apps`, through Homebrew. Checked on every push by GitHub Actions on `macos-latest` with Apple's own `/bin/bash` 3.2: the menu, a dry run of every part, and a real install of `shell`, `tmux`, `browsers` and `rust` followed by `uninstall`. Not yet run by hand on a real Mac; `nvim`, `terminal` (Ghostty) and `web` were only dry-run |
| Windows 10 (1809+) and 11 | **Beta.** `base`, `shell`, `nvim`, `terminal`, `web`, `rust` through winget and PowerShell (see [Windows](#windows)). Checked on every push by GitHub Actions on `windows-latest` under Windows PowerShell 5.1 and PowerShell 7: every script parses, PSScriptAnalyzer, the menu with scripted answers, a dry run of every part, a real install of `shell` and `terminal` (the profile loads in both PowerShells; the default-profile edit keeps `settings.json` comments and is undone by `uninstall`) followed by `uninstall`, a real install of `nvim` (all 18 parsers and 7 Mason servers) and of `web` (PHP extensions, Composer, the MariaDB service left on Manual, a root login, phpMyAdmin). Not yet run by hand on a desktop Windows; `rust` was only dry-run, and the runner has Visual Studio, so the GCC and GNU-toolchain fallbacks were not exercised there |
| Alpine, NixOS, Void, Gentoo | **Not supported.** Contributions are welcome (see below) |

`desktop` (Hyprland + Caelestia) is **Debian 13 only** because it depends on `trixie-backports` and on pinned build
Expand Down
7 changes: 7 additions & 0 deletions config/nvim/dotfiles.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
-- Extra plugin specs on top of the NvChad starter.
-- Linked to ~/.config/nvim/lua/plugins/dotfiles.lua by rhmatzeka/dotfile; edit it in ~/.dotfiles/config/nvim/.
-- (On Windows: %LOCALAPPDATA%\nvim\lua\plugins\dotfiles.lua.)

-- Windows: tree-sitter builds parsers with Visual Studio's cl.exe unless CC names another compiler. The Windows
-- installer brings GCC (WinLibs) when there is no Visual Studio, so point CC at it. Nothing happens on Linux/macOS.
if vim.fn.has("win32") == 1 and (vim.env.CC or "") == "" and vim.fn.executable("cl") == 0 and vim.fn.executable("gcc") == 1 then
vim.env.CC = "gcc"
end

return {
-- Syntax highlighting. Without the html/css/js parsers, a .php or .vue file that is mostly markup stays plain white.
Expand Down
Loading
Loading