Documentation ¶
Index ¶
- Variables
- func Arch() string
- func CheckNix() bool
- func Exists(path string) bool
- func FileContains(path string, substring string) (bool, error)
- func Hostname() (string, error)
- func IsDir(path string) bool
- func IsFile(path string) bool
- func Levels() []string
- func MkdirAll(path string) error
- func Move(oldPath, newPath string) error
- func Name() (string, error)
- func Runtime() string
- func SSHAuthSock() bool
- func UserShell() (string, error)
- func Username() (string, error)
- type Alias
- type Bling
- type Config
- func (c *Config) AddPackage(pack string) error
- func (c *Config) AddProgram(prog string) error
- func (c *Config) AsVersion() (*version.Version, error)
- func (c *Config) CurrentSystem() (*System, error)
- func (c *Config) Eject() error
- func (c *Config) GitLocation() (string, error)
- func (c *Config) Location() (string, error)
- func (c *Config) MakeFlakeDir() error
- func (c *Config) Migrate() error
- func (c *Config) NeedsMigration() bool
- func (c *Config) RemovePackage(pack string) error
- func (c *Config) RemoveProgram(prog string) error
- func (c *Config) Save() error
- func (c *Config) Tracks() string
- func (c *Config) UserFlakeDir() string
- func (c *Config) UserForSystem(system string) *User
- func (c *Config) Validate() error
- func (c *Config) WriteInitialConfig(force bool, symlink bool) error
- type ConfigLine
- type Git
- type Overlay
- type Package
- type Program
- type System
- type User
Constants ¶
This section is empty.
Variables ¶
var ( LowPackages = []string{"htop", "git", "github-cli", "glab"} DefaultPackages = []string{"fzf", "ripgrep", "vscode"} HighPackages = []string{"lazygit", "jq", "yq", "neovim", "neofetch", "btop", "cheat"} LowPrograms = []string{"starship"} DefaultPrograms = []string{"direnv"} HighPrograms = []string{"exa", "bat", "atuin", "zoxide"} )
var ( ErrMissingFlakeDir = errors.New("fleek.yml: missing `flakedir`") ErrInvalidShell = errors.New("fleek.yml: invalid shell, valid shells are: " + strings.Join(shells, ", ")) ErrInvalidBling = errors.New("fleek.yml: invalid bling level, valid levels are: " + strings.Join(blingLevels, ", ")) ErrorInvalidArch = errors.New("fleek.yml: invalid architecture, valid architectures are: " + strings.Join(architectures, ", ")) ErrInvalidOperatingSystem = errors.New("fleek.yml: invalid OS, valid operating systems are: " + strings.Join(operatingSystems, ", ")) ErrPackageNotFound = errors.New("package not found in configuration file") ErrProgramNotFound = errors.New("program not found in configuration file") )
var ErrSysNotFound = errors.New("system not found")
Functions ¶
func CheckNix ¶
func CheckNix() bool
CheckNix verifies that the nix command is available in user's PATH
func FileContains ¶ added in v0.9.4
FileContains checks if a given file at 'path' contains the 'substring'
func IsDir ¶ added in v0.9.4
IsDir returns true if the path exists *and* it is pointing to a directory.
This function will traverse symbolic links to query information about the destination file.
This is a convenience function that coerces errors to false. If it cannot read the path for any reason (including a permission error, or a broken symbolic link) it returns false.
func IsFile ¶ added in v0.9.4
IsFile returns true if the path exists *and* it is pointing to a regular file.
This function will traverse symbolic links to query information about the destination file.
This is a convenience function that coerces errors to false. If it cannot read the path for any reason (including a permission error, or a broken symbolic link) it returns false.
func SSHAuthSock ¶
func SSHAuthSock() bool
Types ¶
type Bling ¶
type Bling struct { Name string `yaml:"name"` Description string `yaml:"description"` Packages []string `yaml:"packages"` Programs []string `yaml:"programs"` PackageMap map[string]*Package ProgramMap map[string]*Program }
func DefaultBling ¶
func (*Bling) FinalPackages ¶ added in v0.9.4
FinalPapckages returns the list of bling packages to install minus anything blocked in the config's Blocklist slice. Git is also removed if BYOGit is specified in the config
func (*Bling) FinalPrograms ¶ added in v0.9.4
FinalPrograms returns the list of bling programs to install minus anything blocked in the config's Blocklist slice. Git is also removed if BYOGit is specified in the config
type Config ¶
type Config struct { MinVersion string `yaml:"min_version"` Debug bool `yaml:"-"` Verbose bool `yaml:"-"` Force bool `yaml:"-"` Quiet bool `yaml:"-"` FlakeDir string `yaml:"flakedir"` Unfree bool `yaml:"unfree"` // bash or zsh Shell string `yaml:"shell"` // low, default, high Bling string `yaml:"bling"` Name string `yaml:"name"` Overlays map[string]*Overlay `yaml:",flow"` Packages []string `yaml:",flow"` Programs []string `yaml:",flow"` // issue 211, remove or block bling packages Blocklist []string `yaml:"blocklist,flow"` Aliases map[string]string `yaml:",flow"` Paths []string `yaml:"paths"` Ejected bool `yaml:"ejected"` // issue 200 - disable any git integration BYOGit bool `yaml:"byo_git"` Systems []*System `yaml:",flow"` Git Git `yaml:"git"` Users []*User `yaml:",flow"` Track string `yaml:"track"` }
Config holds the options that will be merged into the home-manager flake.
func ReadConfig ¶
ReadConfig returns the configuration data pointed to in the $HOME/.fleek.yml symlink
func (*Config) AddPackage ¶
func (*Config) AddProgram ¶
func (*Config) CurrentSystem ¶
func (*Config) GitLocation ¶
GitLocation returns the path for the fleek configuration git directory
func (*Config) MakeFlakeDir ¶
MakeFlakeDir creates the directory that holds the interpolated flake.
func (*Config) NeedsMigration ¶ added in v0.9.4
Needs migration checks to see if the host directory has a file with the same name as the host. e.g. ./beast/beast.nix
func (*Config) RemovePackage ¶
func (*Config) RemoveProgram ¶
func (*Config) UserFlakeDir ¶
func (*Config) UserForSystem ¶ added in v0.9.0
type ConfigLine ¶
ConfigLine represents a line of a program's configuration. It must be in the form of `key = value“ such that multiple config lines for the same program can be appended together to create a valid configuration.
type Program ¶
type Program struct { Name string `yaml:"name"` Description string `yaml:"description"` ConfigLines []ConfigLine `yaml:"config_lines,flow"` Aliases []Alias `yaml:",flow"` }
Program is an application that is installed and also has configuration attached.