dotfiles

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dotfiles manages the user's dotfiles repository: cloning it, running its install script, and reporting on its health (uncommitted or unsynchronised changes, and files not symlinked into $HOME).

Index

Constants

This section is empty.

Variables

View Source
var DefaultModularDotfiles = []string{
	".zshrc",
	".profile",
	".aliases",
	".gitconfig",
	".tmux.conf",
	".vimrc",
	".ideavimrc",
	".bashrc",
	".git-shellrc",
	".node-shellrc",
	".go-shellrc",
}

DefaultModularDotfiles lists the dotfiles that, if present in the dotfiles repo, are expected to be symlinked into $HOME by the install script. Entries not present in the repo are silently skipped — this list is forward-looking and will grow as the dotfiles repo adds modules.

Functions

This section is empty.

Types

type Setup added in v0.0.41

type Setup struct {
	RepoURL   string
	LocalPath string
	// InstallScript is the script to run after cloning, relative to
	// LocalPath. Empty means there is nothing to run.
	InstallScript string
	// ModularFiles are the dotfiles expected to be symlinked from LocalPath
	// into $HOME. Defaults to DefaultModularDotfiles; override in tests.
	ModularFiles []string
	// contains filtered or unexported fields
}

Setup is the machine configuration for a dotfiles repository cloned to a local path and applied by an install script inside it.

func NewSetup added in v0.0.41

func NewSetup(repoURL, localPath, installScript string) *Setup

NewSetup returns a Setup that expects DefaultModularDotfiles to be symlinked into $HOME.

func (Setup) Install added in v0.0.41

func (d Setup) Install(ctx context.Context) (*bytes.Buffer, error)

Install clones the repository if needed, then runs its install script. The script is run every time: it is expected to be idempotent.

func (Setup) Name added in v0.0.41

func (d Setup) Name() string

Name returns the configuration's label.

func (Setup) Uninstall added in v0.0.41

func (d Setup) Uninstall(_ context.Context) (*bytes.Buffer, error)

Uninstall only explains that the clone is not removed automatically.

func (Setup) Validate added in v0.0.41

func (d Setup) Validate(ctx context.Context) (*bytes.Buffer, error)

Validate reports whether the repository is cloned. When it is, advisory warnings about its git state and $HOME symlinks are appended to the output; they never turn into an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL