bartvanremortele
2/15/2013 - 9:02 PM

Personal Boxen Manifest

Personal Boxen Manifest

class people::jfryman {
  # Applications
  include chrome::stable
  include onepassword
  include dropbox
  include alfred
  include macvim
  include zsh
  include homebrew
  include fitbit
  include iterm2::dev
  include java
  include minecraft
  include textmate
  include virtualbox
  include skype
  include caffeine
  include github::apps::play
  include istatmenus3
  include spotify
  include vlc
  include watts
  include things
  include postgresql
  include apachedirectorystudio
  #  include mysql_workbench
  #  include heroku_toolbelt
  #  include omnigraffle
  #  include appcleaner
  #
  # Projects
  include projects::puppet
  include projects::network
  include projects::dns
  include projects::initrd
  include projects::shell
  include projects::infrastructure_wiki
  include projects::ci

  # Sane Defaults
  Boxen::Osx_defaults {
    user => $::luser,
  }

  # App Installations
  # TODO Install Steam (Some EULA?)

  # Configuration Setup
  $env = {
    directories => {
      home      => '/Users/jamison',
      dotfiles  => '/Users/jamison/.dotfiles'
    },
    dotfiles => [
      'aliases',
      'functions',
      'gitconfig',
      'janus/jellybeans',
      'janus/vim-rails',
      'vimrc.after',
      'zshrc',
    ],
    packages => {
      brew   => [
        'wget',
        'gpg2',
        'tmux'
      ]
    }
  }

  # Install Brew Applications
  package { $env['packages']['brew']:
    provider => 'homebrew',
  }

  ####################
  # Start Config

  # OSX Defaults
  boxen::osx_defaults { 'Disable Dashboard':
    key    => 'mcx-disabled',
    domain => 'com.apple.dashboard',
    value  => 'YES',
  }
  boxen::osx_defaults { 'Disable reopen windows when logging back in':
    key    => 'TALLogoutSavesState',
    domain => 'com.apple.loginwindow',
    value  => 'false',
  }
  boxen::osx_defaults { 'Disable press-and-hold character picker':
    key    => 'ApplePressAndHoldEnabled',
    domain => 'NSGlobalDomain',
    value  => 'false',
  }
  boxen::osx_defaults { 'Display full POSIX path as Finder Window':
    key    => '_FXShowPosixPathInTitle',
    domain => 'com.apple.finder',
    value  => 'true',
  }
  boxen::osx_defaults { 'Secure Empty Trash':
    key    => 'EmptyTrashSecurely',
    domain => 'com.apple.finder',
    value  => 'true',
  }
  boxen::osx_defaults { 'Always use current directory in default search':
    key    => 'FXDefaultSearchScope',
    domain => 'com.apple.finder',
    value  => 'SCcf',
  }
  boxen::osx_defaults { 'Do not create .DS_Store':
    key    => 'DSDontWriteNetworkStores',
    domain => 'com.apple.dashboard',
    value  => 'true',
  }
  boxen::osx_defaults { "Disable 'natural scrolling'":
    key    => 'com.apple.swipescrolldirection',
    domain => 'NSGlobalDomain',
    value  => 'false',
  }
  boxen::osx_defaults { 'Disable the "Are you sure you want to open this application?" dialog':
    key    => 'LSQuarantine',
    domain => 'com.apple.LaunchServices',
    value  => 'true',
  }
  boxen::osx_defaults { 'fucking sane key repeat':
    domain => 'NSGlobalDomain',
    key    => 'KeyRepeat',
    value  => '0',
  }
  boxen::osx_defaults { 'Expand save panel by default':
      key    => 'NSNavPanelExpandedStateForSaveMode',
      domain => 'NSGlobalDomain',
      value  => 'true',
  }
  boxen::osx_defaults { 'Expand print panel by default':
      key    => 'PMPrintingExpandedStateForPrint',
      domain => 'NSGlobalDomain',
      value  => 'true',
  }
  boxen::osx_defaults { 'Minimize on Double-Click':
      key    => 'AppleMiniaturizeOnDoubleClick',
      domain => 'NSGlobalDomain',
      value  => 'true',
  }
  boxen::osx_defaults { 'Put my Dock on the left':
    key    => 'orientation',
    domain => 'com.apple.dock',
    value  => 'left',
  }
  boxen::osx_defaults { 'Make function keys do real things, and not apple things':
    key    => 'com.apple.keyboard.fnState',
    domain => 'NSGlobalDomain',
    value  => 'true',
  }

  # Disable GateKeeper
  exec { 'Disable Gatekeeper':
    command => 'spctl --master-disable',
    unless  => 'spctl --status | grep disabled',
  }

  # End Config
  ####################

  # Dotfile Setup
  repository { 'jfryman-dotfiles':
    source => 'jfryman/dotfiles',
    path   => "${env['directories']['dotfiles']}",
  }
  ### This really shoudl be a shell script. DO IT!
  -> people::jfryman::dotfile::link { $env['dotfiles']:
    source_dir => $env['directories']['dotfiles'],
    dest_dir   => $env['directories']['home'],
  }

  # Install Janus
  repository { 'janus':
    source => 'carlhuda/janus',
    path   => "${env['directories']['home']}/.vim",
  }
  ~> exec { 'Boostrap Janus':
    command     => 'rake',
    cwd         => "${env['directories']['home']}/.vim",
    refreshonly => true,
    environment => [
      "HOME=${env['directories']['home']}",
    ],
  }

  # Misc Helpers until I can figure out where to put this
  define dotfile::link($source_dir, $dest_dir) {
    file { "${dest_dir}/.${name}":
      ensure => symlink,
      target => "${source_dir}/${name}",
    }
  }
}