Skip to content

Repository files navigation

dotfiles

Personal dotfiles managed with chezmoi. Supports macOS, Dev Containers, and GitHub Codespaces.

How to install

macOS (fresh setup)

Run the setup script. It installs Homebrew, Oh My Zsh, chezmoi, and applies the dotfiles.

curl -fsSL https://raw.githubusercontent.com/ohyama/dotfiles/main/install-on-mac.sh | bash

During the setup, you will be asked to sign in to 1Password and the App Store.

Dev Container (self-managed)

When connecting to a Dev Container using either VS Code or @devcontainers/cli, you can automatically apply your dotfiles using their built-in features. This repository provides a setup script (install-on-managed-devcontainer.sh) for managed Dev Containers. VS Code and @devcontainers/cli will clone your dotfiles repository into ~/.local/share/chezmoi by default, so you can simply specify the script as the install command.

  • VS Code: Use the dotfiles feature in Settings Sync. Add the following to your user settings.json (not workspace settings) to automatically apply your configuration when attaching to a Dev Container:

    Example (user settings.json):

    {
      "dotfiles.repository": "https://github.com/ohyama/dotfiles.git",
      "dotfiles.targetPath": "~/.local/share/chezmoi",
      "dotfiles.installCommand": "install-on-managed-devcontainer.sh"
    }
  • @devcontainers/cli: Pass dotfiles options as command-line arguments to avoid affecting team members via devcontainer.json. Example:

    devcontainer up --workspace-folder . \
      --dotfiles-repository "https://github.com/ohyama/dotfiles.git" \
      --dotfiles-target-path "~/.local/share/chezmoi" \
      --dotfiles-install-command "install-on-managed-devcontainer.sh"

Both methods support initializing and applying dotfiles managed with chezmoi.

Other environments

chezmoi init --apply ohyama

Packages for each OS are defined in home/.chezmoidata/packages.yaml.

Development

This repository uses the following tools:

npm ci

Install scripts

As a countermeasure against supply chain attacks, install scripts of dependencies (preinstall, install, postinstall, and also prepare for non-registry dependencies) require explicit approval.

  • Approved and denied packages are recorded in allowScripts in package.json
  • strict-allow-scripts=true in .npmrc makes the installation fail when a package has unreviewed install scripts
  • Only scripts of dependencies are covered, so the prepare script of this repository is not affected
  • This requires npm 11.16.0 or later — use the version in .node-version

When npm install fails with ESTRICTALLOWSCRIPTS after adding a package, deny it first and confirm that the tooling still works.

npm deny-scripts <package>

Approve it only when the tooling breaks while denied. npm approve-scripts cannot change an entry that is already denied, so remove the entry from allowScripts in package.json before running it.

npm approve-scripts <package>

Packages with unreviewed install scripts can be listed with the following command.

npm approve-scripts --allow-scripts-pending

About

Personal dotfiles managed with chezmoi.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages