config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config handles configuration management for dodot. It supports loading configuration from multiple sources including TOML files, environment variables, and command-line flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) bool

FileExists is a helper to check if a file exists

func LoadPackConfig

func LoadPackConfig(configPath string) (types.PackConfig, error)

LoadPackConfig reads and parses a pack's .dodot.toml configuration file

Types

type Config added in v0.1.1

type Config struct {
	Security         Security
	Patterns         Patterns
	Priorities       Priorities
	Matchers         []MatcherConfig
	FilePermissions  FilePermissions
	ShellIntegration ShellIntegration
	Paths            Paths
}

Config is the main configuration structure

func Default added in v0.1.1

func Default() *Config

Default returns the default configuration

type FilePermissions added in v0.1.1

type FilePermissions struct {
	Directory  os.FileMode
	File       os.FileMode
	Executable os.FileMode
}

FilePermissions holds file and directory permission settings

type MatcherConfig added in v0.1.1

type MatcherConfig struct {
	Name        string
	Type        string
	Priority    int
	TriggerType string
	TriggerData map[string]interface{}
	PowerUpType string
	PowerUpData map[string]interface{}
}

MatcherConfig represents a matcher configuration

type Paths added in v0.1.1

type Paths struct {
	DefaultDotfilesDir string
	DodotDirName       string
	StateDir           string
	BackupsDir         string
	TemplatesDir       string
	DeployedDir        string
	ShellDir           string
	InstallDir         string
	HomebrewDir        string
	InitScriptName     string
	LogFileName        string
}

Paths holds path-related configuration

type Patterns added in v0.1.1

type Patterns struct {
	PackIgnore      []string
	CatchallExclude []string
	SpecialFiles    SpecialFiles
}

Patterns holds various ignore and exclude patterns

type Priorities added in v0.1.1

type Priorities struct {
	Triggers map[string]int
	PowerUps map[string]int
	Matchers map[string]int
}

Priorities holds component priority settings

type Security added in v0.1.1

type Security struct {
	ProtectedPaths    map[string]bool
	AllowHomeSymlinks bool
	BackupExisting    bool
	EnableRollback    bool
}

Security holds security-related configuration

type ShellIntegration added in v0.1.1

type ShellIntegration struct {
	BashZshSnippet           string
	BashZshSnippetWithCustom string
	FishSnippet              string
}

ShellIntegration holds shell integration snippets

type SpecialFiles added in v0.1.1

type SpecialFiles struct {
	PackConfig    string
	AltPackConfig string
	IgnoreFile    string
}

SpecialFiles holds names of special configuration files

Jump to

Keyboard shortcuts

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