Skip to content
This repository has been archived by the owner on May 22, 2018. It is now read-only.

Dotfiles and Boxen #103

Closed
kevinSuttle opened this issue Mar 4, 2013 · 5 comments
Closed

Dotfiles and Boxen #103

kevinSuttle opened this issue Mar 4, 2013 · 5 comments

Comments

@kevinSuttle
Copy link
Member

What is the recommended practice for this? I think most of us have them symlinked from git to ~/. Do you suggest symlinking them to 'opt/boxen/config/git' etc, or just letting the two live separate lives?

@kevinSuttle
Copy link
Member Author

I should note the first time I loaded up Zsh after I installed Boxen, I got this error:

/Users/kevinsuttle/Code/dotfiles/zsh/colors.zsh:source:10: no such file or directory: /opt/boxen/homebrew/etc/grc.bashrc

I know what this is doing, just giving an example.
See: https://github.com/kevinSuttle/dotfiles/blob/master/bash/.bashrc

@wfarr
Copy link
Contributor

wfarr commented Mar 4, 2013

There are a few approaches to this. The most Puppet-centric way to do it, would be to let Puppet setup symlinks into your dotfiles repo:

$home = "/Users/${::boxen_user}"
$dotfiles_dir = "${boxen::config::srcdir}/dotfiles"

repository { $dotfiles_dir:
  source => "${::github_user}/dotfiles"
}

file { "${home}/.zshrc":
  ensure  => link,
  target  => "${dotfiles_dir}/.zshrc",
  require => Repository[$dotfiles_dir]
}

Another approach is some folks have a shell script that does all their "install" for dotfiles, and just have Puppet invoke that if appropriate:

$home = "/Users/${::boxen_user}"
$dotfiles_dir = "${boxen::config::srcdir}/dotfiles"

repository { $dotfiles_dir:
  source => "${::github_user}/dotfiles"
}

exec { "install dotfiles":
  cwd      => $dotfiles_dir,
  command  => "./install.sh",
  provider => shell,
  creates  => "${home}/.zshrc",
  require  => Repository[$dotfiles_dir]
}

Both are valid, IMO, so choose the path you prefer.

As for the grc load error, my guess is you need to add a package { 'grc': } that comes before your dotfiles install. You can make the bashrc itself a little more robust and let it degrade gracefully as well:

[ -f `brew --prefix`/etc/grc.bashrc ] && source `brew --prefix`/etc/grc.bashrc

@wfarr wfarr closed this as completed Mar 5, 2013
@kevinSuttle
Copy link
Member Author

I think I owe you at least a few beers now @wfarr.

kevinSuttle referenced this issue in holman/dotfiles Mar 5, 2013
My .localrc loads Boxen details, which has Homebrew installs
in it. Loading it after .zsh files get loaded means I can't
get stuff like the grc suite detected on my path
@kevinSuttle
Copy link
Member Author

I've found that I don't need to do much after boxen is installed (I run zsh from Homebrew). As long as my Terminal knows where zsh is, then my dotfiles seem to be fine.

@kevinSuttle
Copy link
Member Author

So, this ties in to #109, because brew --prefix always returns usr/local.

☰  `brew --prefix`/opt/boxen/homebrew/etc/grc.bashrc
zsh: no such file or directory: /usr/local/opt/boxen/homebrew/etc/grc.bashrc

So, for now, I've just dropped the brew --prefix in my colors.zsh

[ -f /opt/boxen/homebrew/etc/grc.bashrc ] &&  source /opt/boxen/homebrew/etc/grc.bashrc

Seems to work fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants