Skip to content
kisepichuPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

328 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

Public chezmoi source for Windows, WSL Ubuntu, macOS, and NixOS dotfiles and agent workflows.

Fresh NixOS

On NixOS the system configuration installs everything this repository only configures: git, curl, mise, fish (as the login shell), tmux, gcc, and on desktops WezTerm, wl-clipboard (Neovim's clipboard), cloudflared (for cloudflared-access-ssh-proxy), fonts, and the input method. It also enables programs.nix-ld so mise's prebuilt binaries can run. Host configurations live in the private infra-private repository; desktops share modules/desktop.nix, and docs/runbooks/desktop-setup.md there walks a fresh laptop from the installer to this bootstrap.

Run the NixOS-only bootstrap from the checkout:

mkdir -p ~/repos
git clone https://github.com/kisepichu/dotfiles.git ~/repos/dotfiles
cd ~/repos/dotfiles
./scripts/bootstrap-nixos.sh

The bootstrap applies this chezmoi source non-interactively, which installs the declared mise tools (including Codex), the tmux and fish plugins, and the omp and Claude Code CLIs under ~/.local/bin. Re-running it restores chezmoi-managed files to the repository state, so commit intentional local edits first. It does not perform any login or create credentials. At the end it warns about commands the NixOS configuration does not provide yet (add them, rebuild, and rerun the bootstrap).

On KDE Plasma, every chezmoi apply also sets these user settings with run_after_38-configure-kde.sh.tmpl: fcitx5 as the input method (only when none is selected), ComicShannsMono Nerd Font as the fixed-width font, no suspend on idle (AC and battery; lid close keeps its default), no screen lock on idle (the screen still dims and turns off; resume from sleep still locks), and natural (reversed) two-finger scrolling on touchpads. The touchpad step goes through KWin, so it needs chezmoi apply to run inside the Plasma session.

On a desktop, gh auth login during the runbook creates and uploads the GitHub SSH key. On a server, create a dedicated GitHub key after the bootstrap:

mkdir -p ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_github_glaceon
cat ~/.ssh/id_ed25519_github_glaceon.pub

Register only the displayed public key in GitHub, then add this host entry to ~/.ssh/config:

Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519_github_glaceon
  IdentitiesOnly yes
chmod 600 ~/.ssh/config
ssh -T git@github.com

Complete the agent authentication manually on that machine:

codex login
claude login
cursor-agent login
# omp: start `omp`, then run /login

Fresh macOS

This path is for a Windows/WSL-first workflow on a new Mac. It is separate from the WSL bootstrap.

xcode-select --install
mkdir -p ~/repos
git clone https://github.com/kisepichu/dotfiles.git ~/repos/dotfiles
cd ~/repos/dotfiles
./scripts/bootstrap-macos.sh

The bootstrap installs everything in the repo-root Brewfile with brew bundle; edit that file to add or remove Homebrew packages. chezmoi apply re-runs brew bundle whenever Brewfile changes. Docker runs on colima (colima start) with Homebrew's docker, docker-compose, and docker-buildx; Docker Desktop is not used.

The managed ~/.gitconfig sets the personal identity and commit signing, then includes the unmanaged ~/.gitconfig.local for machine- or work-specific settings such as includeIf identities and credential helpers.

After the script completes, open Karabiner-Elements once and grant the permissions requested by macOS.

Detailed notes: docs/macos-initial-setup.md

Fresh WSL Ubuntu

  1. Install WSL and Ubuntu from Windows.

    wsl --install -d Ubuntu
  2. Update WSL, then open the Ubuntu shell.

    wsl --update
  3. Clone this repository in WSL.

    sudo apt-get update
    sudo apt-get install -y git
    mkdir -p ~/repos
    git clone https://github.com/kisepichu/dotfiles.git ~/repos/dotfiles
    cd ~/repos/dotfiles
  4. Run the WSL bootstrap.

    ./scripts/bootstrap-wsl-ubuntu.sh
  5. Restart the shell after the bootstrap changes the default shell to fish.

    exec fish -l

Docker Engine On WSL

Install Docker Engine directly inside WSL Ubuntu when container-based project work is needed.

Docker Engine expects systemd in WSL. Current Ubuntu installs through wsl --install should use systemd by default; verify it when needed:

cat /proc/1/comm

If the output is not systemd, enable it inside the distro and restart WSL:

sudoedit /etc/wsl.conf

Add or update this section while preserving any existing settings:

[boot]
systemd=true
wsl --terminate Ubuntu

Replace Ubuntu with the distro name when it differs.

cd ~/repos/dotfiles
./scripts/install-docker-engine-wsl.sh

The script prompts before adding your user to the docker group. Accept only if you want to run Docker without sudo; Docker daemon access is effectively root-equivalent inside the WSL distro.

Then close and reopen the WSL session if you accepted the group change. Verify the install:

docker run --rm hello-world
docker compose version

If you declined the group change, use sudo for daemon access:

sudo docker run --rm hello-world
docker compose version

The script follows Docker's official Ubuntu apt repository flow and installs docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, and docker-compose-plugin.

Nix (optional)

Nix is not part of the core bootstrap. Install it explicitly when a reproducible nix develop shell or optional Nix-managed tooling is wanted. The script uses the Determinate Nix Installer and supports macOS and WSL Ubuntu.

cd ~/repos/dotfiles
./scripts/install-nix.sh

On WSL, the script detects whether systemd is PID 1. If it is not (no systemd=true in /etc/wsl.conf), it installs with --init none so the install does not depend on a systemd-managed nix-daemon. For a systemd-managed daemon, enable systemd in WSL first (see the Docker section above).

Options:

  • NIX_INSTALL_NO_CONFIRM=1 runs the installer non-interactively.
  • NIX_INSTALL_DETERMINATE=1 installs Determinate Nix instead of upstream Nix.

Open a new shell after installing; conf.d/nix.fish sources the nix profile automatically. To uninstall a Determinate install:

/nix/nix-installer uninstall

On macOS, agenix (used to edit secrets in the NixOS configuration) is installed into the Nix profile:

nix profile install github:ryantm/agenix

Rust

Rust is managed by mise (declared in ~/.config/mise/config.toml). After chezmoi apply, mise install installs the toolchain and run_onchange_after_45-rust-components.sh.tmpl adds the rust-analyzer and rust-src components that neovim (rustaceanvim) needs. No manual step is required; open neovim in a Rust project and the LSP starts.

Agent CLIs

codex, claude, omp, and cursor-agent are installed on every platform (macOS, WSL Ubuntu, NixOS) by chezmoi apply:

  • codex is declared in the mise tool list (~/.config/mise/config.toml) and resolves to the aqua:openai/codex prebuilt release binary. Upgrade it with mise up codex.
  • omp, claude, and cursor-agent are installed by run_after_50-install-agent-clis.sh from their upstream installers (https://omp.sh/install, https://claude.ai/install.sh, https://cursor.com/install) into ~/.local/bin.

That script runs on every apply and skips any CLI already on PATH, because these binaries update themselves (omp update, Claude Code's built-in updater, cursor-agent update). Their versions are deliberately not pinned here. A failed download warns instead of aborting chezmoi apply, and the next apply retries it — which is why this is not a run_once_ script.

Machines set up before this layout may hold a copy from an older channel. Remove it before the first apply, because the npm-installed claude occupies the same ~/.local/bin/claude path the installer would create: the script sees it, skips the install, and the later npm uninstall then leaves Claude Code absent. If the cleanup already ran after an apply, just run chezmoi apply again.

# macOS
brew uninstall --cask codex
# NixOS (installed by the old bootstrap)
npm --prefix ~/.local uninstall -g @openai/codex @anthropic-ai/claude-code

Authenticate once per machine; this repository stores no credentials.

codex login
claude login
cursor-agent login
# omp: start `omp`, then run /login

On macOS, ~/.tmux.conf sets PI_FORCE_IMAGE_PROTOCOL=sixel for everything started inside tmux. omp's default there (Kitty images through tmux passthrough) puts images at the top-left of the screen and leaves pieces behind (can1357/oh-my-pi#19396); tmux draws SIXEL itself. New panes pick it up after tmux source-file ~/.tmux.conf. Remove the setting once omp chooses SIXEL inside tmux by itself.

tmux-resurrect brings panes back after a reboot but not the omp sessions in them. omp-panes covers that:

omp-panes save          # before rebooting
omp-panes restore -n    # after tmux restored the panes: print what would be typed
omp-panes restore       # type `cd <dir> && omp <launch flags> --resume <session file>` into each pane

save records, per pane (session:window.pane, which resurrect restores as-is), the session file the running omp owns, its working directory, and its launch flags (--profile, --model, ...). Resume/continue/goal flags and positional prompts are dropped, so a restore never re-sends a prompt. restore only types into panes sitting at a shell prompt and skips the rest, so running it twice is safe. The record is $XDG_STATE_HOME/omp-panes.json (default ~/.local/state). It needs python3 3.9+; on macOS it also uses lsof, on Linux it reads /proc.

yazi

yazi is the terminal file manager on every platform. It is in the mise tool list and resolves to the aqua:sxyazi/yazi prebuilt release, which also ships ya.

  • Shell: y (fish) starts yazi; quitting with q moves the shell to the directory yazi was in, Q quits without moving.
  • Neovim: <leader>fy opens yazi at the current file and <leader>fY at the working directory (yazi.nvim). neo-tree stays on <leader>e.
  • Inside yazi: z jumps to a directory with fzf, Z with zoxide, s searches file names with fd, S searches contents with rg, o opens with the OS default app.
  • OS default app (~/.config/yazi/yazi.toml): macOS uses open; Linux uses wslview when it exists (WSL, from wslu) and xdg-open otherwise.

Image previews go through WezTerm's inline images protocol. Inside tmux they need allow-passthrough and the outer TERM / TERM_PROGRAM, which ~/.tmux.conf sets. A running tmux server picks this up after a reload and a reattach:

tmux source-file ~/.tmux.conf
# detach (prefix d), then
tmux attach

Neovim's terminal has no graphics protocol, so yazi.nvim shows no images. On WSL, image previews need a path without ConPTY, which is why the Windows WezTerm opens WSL over SSH (docs/wezterm.md).

Neovim PHP And Diffview

phpactor does not support Diffview's diffview: URI scheme. Its LSP activation excludes those virtual buffers, including editable Git index buffers whose buftype is empty. Normal PHP files and real working-tree files displayed inside Diffview keep their LSP support and existing workspace root detection.

Neovim In Dev Containers

Use Neovim and this repository's Neovim config inside a project's dev container without changing the project. dcup (fish) runs devcontainer up with this repository as the dotfiles repository; the Dev Container CLI clones it into the container and runs scripts/install-devcontainer-neovim.sh once per container.

dcup                               # in the project directory
dcnvim                             # open Neovim in the container
dcup --remove-existing-container   # recreate the container to pick up dotfiles changes

The script installs Neovim, the tree-sitter CLI, Deno, ripgrep, fd, and the SKK dictionary, applies only ~/.config/nvim with chezmoi (no run_ scripts), and restores the plugins to lazy-lock.json. It supports apt-based (Debian/Ubuntu) glibc images, as root or with sudo. When the image moves XDG_CONFIG_HOME away from ~/.config, it links $XDG_CONFIG_HOME/nvim to the applied config.

devcontainer up still succeeds when the install script fails, so check its output for Neovim is ready in the dev container. Plugin download errors (for example, a dropped connection to GitHub) do not fail the script either. The script is safe to run again inside the container; it puts lazy-lock.json back and restores the plugins to it:

~/dotfiles/scripts/install-devcontainer-neovim.sh

The container gets the pushed config; edits made inside it stay in the container. To try unmerged changes, mount a local checkout into the container from the project side and point dcup at the container path, for example DCUP_DOTFILES_REPOSITORY=/path/in/container dcup. The CLI clones the checked-out branch of that path.

Project-specific settings, such as publishing the UI port that the CLI does not forward or mounting credentials (~/.wakatime.cfg), stay in the project's local, git-ignored configuration.

Validation

Before committing, run:

prek run --all-files

If prek is not available, run:

pre-commit run --all-files

Run the PHP/Diffview LSP regression test with Neovim 0.11+; it does not require installed plugins or phpactor:

nvim --headless -u NONE -i NONE -n -l scripts/test-nvim-phpactor.lua

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages