Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

dotfiles (3) Versions 1.0.1

A collection of custom resources that manage user dotfiles.

Berkshelf/Librarian
Policyfile
Knife
cookbook 'dotfiles', '= 1.0.1'
cookbook 'dotfiles', '= 1.0.1', :supermarket
knife cookbook site install dotfiles
knife cookbook site download dotfiles
README
Dependencies
Quality 0%

dotfiles

A collection of custom resources that manage user dotfiles.

Chef Cookie Cutter

This cookbook bundles the Cookie Cutter gem, which provides a lot of the dotfile functionality. All DSL extensions from the Cookie Cutter gem are directly available if this cookbook is included. In fact, this cookbook is pretty much the playground, testing area and main reason that gem exists.

Requirements

This cookbook requires Chef >= 12.5.1.

Resources

bash_dotfile

Creates the Bash configuration file for a user, by default ~/.bashrc.

This resource includes the following mixins:

Property Description Default
bash_it Include Bash It configuration. Must be a bash_it_dotfile resource or a block. nil
prompt Configure the Bash prompt (see Prompt Builder). nil
option Set either a Bash option or Shell option. This attribute can be specified multiple times. nil

Bash Prompt

The bash_dotfile supports the Prompt Builder and adds the following options:

  • date: The date in "Weekday Month Date" format (e.g., "Tue May 26")
  • hostname_short: The hostname up to the first `.'
  • hostname_long: The full hostname
  • hostname: The full hostname (equivalent to hostname_long)
  • jobs: The number of jobs currently managed by the shell
  • tty: The basename of the shell's terminal device name
  • shell: The name of the shell
  • time: The current time in 24-hour HH:MM:SS format
  • time_24h: The current time in 24-hour HH:MM:SS format
  • time_12h: The current time in 12-hour HH:MM:SS format
  • time_am_pm: The current time in 12-hour am/pm format
  • user: The username of the current user
  • version: The version of bash (e.g., 2.00)
  • version_long: The release of bash, version + patch level (e.g., 2.00.0)
  • cwd: The current working directory, with $HOME abbreviated with a tilde
  • cwd_base: The basename of the current working directory, with $HOME abbreviated with a tilde
  • history: The history number of this command
  • command: The command number of this command
  • pound: If the effective UID is 0, a #, otherwise a $

bash_it_dotfile

Installs Bash It. This resource alone will not configure Bash to use Bash It. To do this, add this resource to a bash_dotfile resource.

This resource includes the following mixins:

Property Description Default
theme Set the Bash It theme. "bobby"
option arguments: (name, value) Export a Bash It option. This attribute can be specified multiple times. nil
feature arguments: (name, type) Enables a Bash It feature. This attribute can be specified multiple times. nil
aliases Enables an 'aliases' feature. This attribute can be specified multiple times. nil
completion Enables a 'completion' feature. This attribute can be specified multiple times. nil
plugin Enables a 'plugin' feature. This attribute can be specified multiple times. nil

conky_dotfile

Creates a Conky configuration file, by default ~/.conkyrc.

This resource includes the following mixins:

Property Description Default
text Set the Conky TEXT contents nil
option arguments: (name, value) Set a Conky option. This attribute can be specified multiple times. nil

generic_dotfile

Creates a generic configuration file.

This resource includes the following mixins:

Property Description Default
parameters A hash of parameters that can be used in the dotfile. {}

git_dotfile

Creates a Git configuration file, by default ~/.gitconfig.

This resource includes the following mixins:

Property Description Default
url Define a URL option. Can be passed an additional block with options. This attribute can be specified multiple times. nil
git_alias arguments: (name, command) Define a Git alias. This attribute can be specified multiple times. nil
include_path Include an additional config file. This attribute can be specified multiple times. nil

Git color scheme

The git_dotfile resource supports color schemes. If given, it will configure the diff, branches and status output to use colors from the given color scheme.

gnupg_dotfile

Creates a GnuPG configuration file, by default ~/.gnupg/gpg.conf.

This resource includes the following mixins:

Property Description Default
option arguments: (name, value, ...) Set a GnuPG option. This attribute can be specified multiple times. nil

ssh_dotfile

Creates a SSH configuration file, by default ~/.ssh/config.

This resource includes the following mixins:

Property Description Default
option arguments: (name, value) Set a global SSH option. This attribute can be specified multiple times. nil
host Define a host. Can be passed an additional block with options. This attribute can be specified multiple times. nil

tmux_dotfile

Creates a tmux configuration file, by default ~/.tmux.conf.

This resource includes the following mixins:

Property Description Default
prefix_key Rebind the tmux prefix key. nil
option arguments: (name, value=true, scope: '') Set a tmux option with the given scope. This attribute can be specified multiple times. nil
session_option arguments: (name, value=true) Set a tmux session option (default scope). This attribute can be specified multiple times. nil
window_option arguments: (name, value=true) Set a tmux window option (scope = 'w'). This attribute can be specified multiple times. nil
server_option arguments: (name, value=true) Set a tmux server option (scope = 's'). This attribute can be specified multiple times. nil
bind_key arguments: (key, command, arguments, ..., no_prefix: false, key_table: nil) Bind a key to a command. This attribute can be specified multiple times. nil
unbind_key Remove an existing keybinding. This attribute can be specified multiple times. nil

vim_dotfile

Creates a Vim configuration file, by default ~/.vimrc.

This resource includes the following mixins:

Property Description Default
colors Set the Vim colorscheme. nil
pathogen Include Vim Pathogen configuration. Must be a vim_pathogen_dotfile resource or a block. nil
option arguments: (name, value=true) Set a Vim option. This attribute can be specified multiple times. nil
global_variable arguments: (name, value=true) Set a global Vim variable. This attribute can be specified multiple times. nil
directory_option arguments: (name, directory) Set a Vim option to a directory relative to home, and create that directory. This attribute can be specified multiple times. nil

vim_colors_dotfile

Creates a Vim colorscheme file in '~/.vim/colors/<name>.vim'.

This resource includes the following mixins:

Property Description Default
colors_name Name of the colorscheme, also determines the filename. nil
background If the colorscheme should set a light or dark background. nil
highlight arguments: (name, foreground: nil, background: nil, attribute: nil) Define a highlight option. This attribute can be specified multiple times. nil

vim_pathogen_dotfile

Installs Vim Pathogen. This resource alone will not configure Vim to use Pathogen. To do this, add this resource to a vim_dotfile resource.

This resource includes the following mixins:

Property Description Default
plugin_directory The target directory where Pathogen stores itself and plugins. ".vim/bundle"
install_plugin arguments: (name, git_repository) Install a plugin for Pathogen. This attribute can be specified multiple times. nil

xmonad_dotfile

Creates a xmonad configuration file, by default ~/.xmonad/xmonad.hs.

This resource includes the following mixins:

Property Description Default
import Import a haskell module. This attribute can be specified multiple times. nil
config Name of the function that supplies the xmonad config object. "defaultConfig"
config_modifier Function that is applied to the config object. This attribute can be specified multiple times. nil
terminal Name of the terminal emulator that is spawned by default. "xterm"
focus_follows_mouse Whether the window focus should follow the mouse cursor. true
border_width Size of the border around windows. 1
mod_mask Name of the modifier key. Affects all key bindings. "mod1Mask"
workspaces Haskell expression that defines the available workspaces. "map show [1 .. 9 :: Int]"
normal_border_color Border color for normal windows. "#dddddd"
focused_border_color Border color for focused windows. "#ff0000"
key_binding arguments: (key, action:, shift: false) Bind an action to a key. This attribute can be specified multiple times. nil
mouse_binding arguments: (key, action: shift: false) Bind an action to a mouse button. This attribute can be specified multiple times. nil
layout_hook Name of a Haskell function that is used as the layout hook. nil
manage_hook Name of a Haskell function that is used as the manage hook. nil
handle_event_hook Name of a Haskell function that is used as the manage event hook. nil
log_hook Name of a Haskell function that is used as the log hook. nil
startup_hook Name of a Haskell function that is used as the startup hook. nil
haskell_block Define a plain Haskell block in the configuration file. This attribute can be specified multiple times. nil

Xmonad color scheme

The xmonad_dotfile resource supports color schemes. If given, it will configure the border color of normal and focused windows to use colors from the given color scheme.

xresources_dotfile

Creates an X resources file, by default ~/.Xresources.

This resource includes the following mixins:

Property Description Default
xresource arguments: (name, value) Configure an X resource. This attribute can be specified multiple times. nil

X color scheme

The xresources_dotfile resource supports color schemes. If given, it will configure the default color palette as well as foreground and background colors from the color scheme.

xsession_dotfile

Creates an X startup script file, by default ~/.xsession.

This resource includes the following mixins:

Property Description Default
wm_command Shell command that represents the session. The session will stop when this command returns. nil
command Shell command that should be executed at the start of the session. This attribute can be specified multiple times. nil
xresources_from_file Merge the configuration from the given files into xrdb. This attribute can be specified multiple times. nil
xresource arguments: (name, value) Merge a given X resource configuration directly into xrdb. This attribute can be specified multiple times. nil
option arguments: (command, option, argument, ...) Set a X option with either the xsetroot or xset command. This attribute can be specified multiple times. nil
cursor Set the X cursor. nil
background_image Set the X background image to a bitmap. nil
background_color Set the X background to a solid color. nil
bell Configure the bell. Arguments can be 'off' or a combination of volume:, pitch: and duration:. nil
click Configure key clicks. Arguments can be 'on', 'off' or a volume in percent. nil
dpms Configure DPMS parameters. Arguments can be 'off', or a combination of standby:, suspend: and off:. nil
font_path Append an element to the current font path. nil
mouse arguments: (acceleration: 2, threshold: 0) Configure mouse parameters. nil
pixel arguments: (entry:, color:) Configure pixel color values in the color map. nil
screen_saver Configure screen saver parameters. Arguments can be 'on' or 'off'. nil

X session color scheme

The xsession_dotfile resource supports color schemes. If given, it will configure a solid background color from the color scheme.

zsh_dotfile

Creates the Zsh configuration file for a user, by default ~/.zshrc.

This resource includes the following mixins:

Property Description Default
oh_my_zsh Include Oh My Zsh configuration. Must be a oh_my_zsh_dotfile resource or a block. nil
prompt Configure the Zsh prompt (see Prompt Builder). nil
option Set a Zsh option. This attribute can be specified multiple times. nil

oh_my_zsh_dotfile

Installs Oh My Zsh. This resource alone will not configure Zsh to use Oh My Zsh. To do this, add this resource to a zsh_dotfile resource.

This resource includes the following mixins:

Property Description Default
plugin_directory Directory that Oh My Zsh uses to store plugins, relative to home directory. "custom/plugins"
theme The selected Oh My Zsh theme. "robbyrussell"
option arguments: (name, value) Export a Oh My Zsh option. This attribute can be specified multiple times. nil
plugin arguments: (name, git: nil, enable: true) Install and enable a Oh My Zsh plugin. This attribute can be specified multiple times. nil

Mixin Resources

Mixin resources are resources that are used like ruby mixins. This means that they can not be used directly, but add common functionality to other resources.

dotfiles_colorscheme

Adds support for color schemes to a dotfile resource.

Property Description Default
colorscheme Set the color scheme for the dotfile. nil

dotfiles_dotfile

This is the base resource for dotfiles. It declares default actions and common properties for all dotfiles. A dotfile has one of these types: * :template Creates target file relative to the user's home directory, based on a ruby template. * :git_checkout Creates a target directory relative to the user's home directory that is synced with a git repository. In addition, a dotfile can create additional required directories, or perform additional actions in form of Chef resources.

Action Description Default
[:create] true
create Creates the dotfile false
Property Description Default
target The file or directory created, implementing the dotfile. nil
source The source for the dotfile. Either a template or git resource, depending on the dotfile type. nil
executable Whether the dotfile should be executable. false
type Determines how the dotfile is installed. Either :template or :git_checkout. :template
create_directory Creates a directory relative to the home directory. This attribute can be specified multiple times. nil
additional_action A proc defining an additional action to be performed. This attribute can be specified multiple times. nil

dotfiles_shell

This is the base resources for shell dotfiles. It adds some common properties for shells.

Property Description Default
shell_alias arguments: (name, command) Define a shell alias. This attribute can be specified multiple times. nil
variable arguments: (name, value) Export an environment variable. This attribute can be specified multiple times. nil
path Add a directory to the PATH environment variable. This attribute can be specified multiple times. nil
source_file Source an external file for custom configuration. This attribute can be specified multiple times. nil
script Include a snippet of plain shell script. This attribute can be specified multiple times. nil

dotfiles_user_info

This resource adds a set of properties to a dotfile resource. It supplies user information that can be used by the dotfile.

Property Description Default
user User name for which the dotfile is created. Defaults to the current user.
group Group that will own the created dotfile. Defaults to GID of the provided user.
home Home directory of the dotfile. All paths will be relative to this. Defaults to the home directory of the provided user.
full_name Full name of the user. Can be used by all dotfiles that want to use this.
email Email of the user. Can be used by all dotfiles that want to use it. nil

Recipes

dotfiles::colorschemes

Defines a set of color schemes in form of shared blocks. These blocks can be used in any dotfile resource that supports colorschemes. The defined blocks are: * :solarized_dark_colors for the solarized dark color palette * :solarized_light_colors for the solarized light color palette * :zenburn_colors for a basic zenburn-inspired theme

dotfiles::shell_options

Defines a set common shell options in form of shared blocks. These blocks can be used in any shell dotfile resource. The defined blocks are: * :shell_common_aliases: a set of general purpose shell aliases * :shell_histoly: increased history size for bash and zsh.

dotfiles::tmux_options

Defines a set common tmux options in form of shared blocks. These blocks can be used in the tmux dotfile resource. The defined blocks are: * :tmux_vi_navigation: implements vi-like navigation for tmux

License and Maintainer

Maintainer:: Ole Claussen (claussen.ole@gmail.com)

Source:: https://github.com/oclaussen/chef-dotfiles

Issues:: https://github.com/oclaussen/chef-dotfiles/issues

License:: Apache 2.0

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Foodcritic Metric
            

1.0.1 failed this metric

FC005: Avoid repetition of resource declarations: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/recipes/colorschemes.rb:28
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/bash.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/bash_it.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/conky.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/generic.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/git.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/gnupg.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/ssh.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/tmux.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/vim.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/vim_colors.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/vim_pathogen.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/xmonad.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/xresources.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/xsession.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/zsh.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/c4815ac36d000d345ce9ef1d/dotfiles/resources/zsh_oh_my_zsh.rb:1