godot

command module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 1 Imported by: 0

README

godot

Still another dotfiles manager, this time in go

This project mostly functioned as a learning exercise for teaching myself Go. I had written a custom dotfiles manager in Python, so rewriting in Go seemed feasible since I knew my personal requirements , thus making it a "solved" problem for me.

Installation

Compiled binaries can be found on the releases page here . Optionally, clone this repository and run go install

Setup

godot depends on 2 distinct configuration files.

~/.config/godot/config.json

This config contains only 2 values

Value Meaning Optional
target This is the "name" of this computer, used to track what files it will recieve True, defaults to current hostname
dotfiles_root The root of the repository godot should use to look for templates and manage its settings True, defaults to ~/dotfiles

Example:

{
	"target": "desktop",
	"dotfiles_root": "/home/njohnson/my_dotfiles"
}
<dotfiles_root>/config.json

This is managed by godot, and contains what files are under its control, and what hosts should get what files. While this file can be managed by hand, it's better to let godot do it.

Templating

The files stored in the dotfiles repository will be evaluated as go templates. Information about Go's templating can be found here. Godot defines supplements that with the following

Value Type Meaning Example Usage
Target variable The name of the current target Export an environment variable with the current target name
export GODOT_TARGET="{{ .Target }}"
Submodules variable A special directory in the dotfiles repo for using git submodules export PATH="{{ .Submodules }}/fzf/bin:${PATH}"
Home variable Path to the current users home directory export PATH={{ .Home }}/bin:${PATH}
oneOf function shorthand for evaulating if the current target is in a list
{{ if oneOf . "work" "home" }}
export FOO="bar"
{{ end }}
notOneOf function The inverse of oneOf, evaluates if the target is not one of the list

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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