Commit 225d9deac5ebc1ee4db7da59a1a4a70dcc9a27f6
1 parent
fd662c9d34
Exists in
master
Use puppet-dotfiles to manage configs
Showing 6 changed files with 72 additions and 194 deletions Side-by-side Diff
Puppetfile
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | github "dnsmasq", "1.0.1" |
| 42 | 42 | github "gcc", "2.0.101" |
| 43 | 43 | github "git", "2.4.0" |
| 44 | -github "homebrew", "1.9.4.rc", :repo => "hanjianwei/puppet-homebrew" | |
| 44 | +github "homebrew", "1.9.4" | |
| 45 | 45 | github "hub", "1.3.0" |
| 46 | 46 | github "inifile", "1.0.3", :repo => "puppetlabs/puppetlabs-inifile" |
| 47 | 47 | github "nginx", "1.4.3" |
| ... | ... | @@ -59,4 +59,5 @@ |
| 59 | 59 | github "osx", "2.7.0" |
| 60 | 60 | github "property_list_key", "0.2.1", :repo => "glarizza/puppet-property_list_key" |
| 61 | 61 | github "brewcask", "0.0.4.rc2", :repo => "hanjianwei/puppet-brewcask" |
| 62 | +github "dotfiles", "0.0.2", :repo => "hanjianwei/puppet-dotfiles" |
Puppetfile.lock
| ... | ... | @@ -19,6 +19,11 @@ |
| 19 | 19 | git (2.4.0) |
| 20 | 20 | |
| 21 | 21 | GITHUBTARBALL |
| 22 | + remote: boxen/puppet-homebrew | |
| 23 | + specs: | |
| 24 | + homebrew (1.9.4) | |
| 25 | + | |
| 26 | +GITHUBTARBALL | |
| 22 | 27 | remote: boxen/puppet-hub |
| 23 | 28 | specs: |
| 24 | 29 | hub (1.3.0) |
| 25 | 30 | |
| ... | ... | @@ -79,9 +84,9 @@ |
| 79 | 84 | brewcask (0.0.4.rc2) |
| 80 | 85 | |
| 81 | 86 | GITHUBTARBALL |
| 82 | - remote: hanjianwei/puppet-homebrew | |
| 87 | + remote: hanjianwei/puppet-dotfiles | |
| 83 | 88 | specs: |
| 84 | - homebrew (1.9.4.rc) | |
| 89 | + dotfiles (0.0.2) | |
| 85 | 90 | |
| 86 | 91 | GITHUBTARBALL |
| 87 | 92 | remote: puppetlabs/puppetlabs-inifile |
| 88 | 93 | |
| ... | ... | @@ -102,9 +107,10 @@ |
| 102 | 107 | boxen (= 3.6.1) |
| 103 | 108 | brewcask (= 0.0.4.rc2) |
| 104 | 109 | dnsmasq (= 1.0.1) |
| 110 | + dotfiles (= 0.0.2) | |
| 105 | 111 | gcc (= 2.0.101) |
| 106 | 112 | git (= 2.4.0) |
| 107 | - homebrew (= 1.9.4.rc) | |
| 113 | + homebrew (= 1.9.4) | |
| 108 | 114 | hub (= 1.3.0) |
| 109 | 115 | inifile (= 1.0.3) |
| 110 | 116 | module-data (= 0.0.3) |
modules/people/manifests/hanjianwei/applications.pp
| 1 | -class people::hanjianwei::applications( | |
| 2 | - $home = $people::hanjianwei::config::home, | |
| 3 | - $dotfiles = $people::hanjianwei::config::dotfiles | |
| 4 | -) { | |
| 1 | +class people::hanjianwei::applications { | |
| 5 | 2 | |
| 6 | 3 | # Declare all Homebrew packages |
| 7 | - package { | |
| 8 | - [ | |
| 9 | - 'wget', | |
| 10 | - 'qt5', | |
| 11 | - 'tmux', | |
| 12 | - 'vim' | |
| 13 | - ]: | |
| 4 | + package { ['wget', | |
| 5 | + 'qt5', | |
| 6 | + 'tmux', | |
| 7 | + 'vim']: | |
| 14 | 8 | } |
| 15 | 9 | |
| 16 | 10 | homebrew::tap { 'homebrew/science': } |
| ... | ... | @@ -20,42 +14,39 @@ |
| 20 | 14 | # Declare all Hombrew Cask packages |
| 21 | 15 | include brewcask |
| 22 | 16 | |
| 23 | - package { | |
| 24 | - [ | |
| 25 | - 'acorn', | |
| 26 | - 'alfred', | |
| 27 | - 'atom', | |
| 28 | - 'bettertouchtool', | |
| 29 | - 'caffeine', | |
| 30 | - 'cleanmymac', | |
| 31 | - 'dropbox', | |
| 32 | - 'evernote', | |
| 33 | - 'fantastical', | |
| 34 | - 'firefox', | |
| 35 | - 'google-chrome', | |
| 36 | - 'hazel', | |
| 37 | - 'iterm2', | |
| 38 | - 'keyboard-maestro', | |
| 39 | - 'keyremap4macbook', | |
| 40 | - 'mactex', | |
| 41 | - 'omnifocus', | |
| 42 | - 'onepassword', | |
| 43 | - 'parallels', | |
| 44 | - 'pycharm-ce', | |
| 45 | - 'scapple', | |
| 46 | - 'screenflow', | |
| 47 | - 'scrivener', | |
| 48 | - 'seil', | |
| 49 | - 'shiori', | |
| 50 | - 'trim-enabler', | |
| 51 | - 'qq', | |
| 52 | - 'qt-creator', | |
| 53 | - 'vagrant', | |
| 54 | - 'virtualbox', | |
| 55 | - 'welly', | |
| 56 | - 'xmind' | |
| 57 | - ]: | |
| 58 | - provider => 'brewcask' | |
| 17 | + package { ['acorn', | |
| 18 | + 'alfred', | |
| 19 | + 'atom', | |
| 20 | + 'bettertouchtool', | |
| 21 | + 'caffeine', | |
| 22 | + 'cleanmymac', | |
| 23 | + 'dropbox', | |
| 24 | + 'evernote', | |
| 25 | + 'fantastical', | |
| 26 | + 'firefox', | |
| 27 | + 'google-chrome', | |
| 28 | + 'hazel', | |
| 29 | + 'iterm2', | |
| 30 | + 'keyboard-maestro', | |
| 31 | + 'keyremap4macbook', | |
| 32 | + 'mactex', | |
| 33 | + 'omnifocus', | |
| 34 | + 'onepassword', | |
| 35 | + 'parallels', | |
| 36 | + 'pycharm-ce', | |
| 37 | + 'scapple', | |
| 38 | + 'screenflow', | |
| 39 | + 'scrivener', | |
| 40 | + 'seil', | |
| 41 | + 'shiori', | |
| 42 | + 'trim-enabler', | |
| 43 | + 'qq', | |
| 44 | + 'qt-creator', | |
| 45 | + 'vagrant', | |
| 46 | + 'virtualbox', | |
| 47 | + 'welly', | |
| 48 | + 'xmind']: | |
| 49 | + provider => 'brewcask' | |
| 59 | 50 | } |
| 60 | 51 | |
| 61 | 52 | # Taps |
| 62 | 53 | |
| 63 | 54 | |
| 64 | 55 | |
| 65 | 56 | |
| 66 | 57 | |
| 67 | 58 | |
| 68 | 59 | |
| 69 | 60 | |
| 70 | 61 | |
| ... | ... | @@ -77,78 +68,37 @@ |
| 77 | 68 | provider => 'brewcask' |
| 78 | 69 | } |
| 79 | 70 | |
| 80 | - # tmux | |
| 81 | - Package['tmux'] | |
| 82 | - -> | |
| 83 | - file { "${home}/.tmux.conf": | |
| 84 | - ensure => link, | |
| 85 | - target => "${dotfiles}/tmux/tmux.conf", | |
| 86 | - require => Repository["${dotfiles}"] | |
| 71 | + # Apps configuration | |
| 72 | + class { 'dotfiles::tmux': | |
| 73 | + require => Package['tmux'], | |
| 87 | 74 | } |
| 88 | 75 | |
| 89 | - # Vim | |
| 90 | - Package['vim'] | |
| 91 | - -> | |
| 92 | - file { "${home}/.vimrc": | |
| 93 | - ensure => link, | |
| 94 | - target => "${dotfiles}/Vim/vimrc", | |
| 95 | - require => Repository["${dotfiles}"] | |
| 76 | + class { 'dotfiles::vim': | |
| 77 | + require => Package['vim'], | |
| 96 | 78 | } |
| 97 | - -> | |
| 98 | - file { ["${home}/.vim", "${home}/.vim/bundle"]: | |
| 99 | - ensure => directory | |
| 79 | + | |
| 80 | + class { 'dotfiles::emacs': | |
| 81 | + require => Package['emacs-mac'], | |
| 100 | 82 | } |
| 101 | - -> | |
| 102 | - repository { "${home}/.vim/bundle/Vundle.vim": | |
| 103 | - source => 'gmarik/Vundle.vim' | |
| 83 | + | |
| 84 | + class { 'dotfiles::vimperator': | |
| 85 | + require => Package['firefox'], | |
| 104 | 86 | } |
| 105 | - -> | |
| 106 | - exec { 'vim +BundleInstall +BundleClean +qall': } | |
| 107 | 87 | |
| 88 | + class { 'dotfiles::keyremap4macbook': | |
| 89 | + require => Package['keyremap4macbook'], | |
| 90 | + } | |
| 108 | 91 | |
| 109 | - # Emacs mac port | |
| 110 | - Package['emacs-mac'] | |
| 111 | - -> | |
| 112 | - file { "${home}/.emacs.d": | |
| 113 | - ensure => directory | |
| 92 | + class { 'dotfiles::seil': | |
| 93 | + require => Package['seil'] | |
| 114 | 94 | } |
| 115 | - -> | |
| 116 | - file { "${home}/.emacs.d/init.el": | |
| 117 | - ensure => link, | |
| 118 | - target => "${dotfiles}/Emacs/init.el", | |
| 119 | - require => Repository["${dotfiles}"] | |
| 120 | - } | |
| 121 | - -> | |
| 122 | - repository { "${home}/.emacs.d/snippets": | |
| 123 | - source => 'hanjianwei/yasnippet-snippets' | |
| 124 | - } | |
| 125 | 95 | |
| 126 | - # Firefox | |
| 127 | - Package['firefox'] | |
| 128 | - -> | |
| 129 | - file { "${home}/.vimperatorrc": | |
| 130 | - target => "${dotfiles}/Vimperator/vimperatorrc", | |
| 131 | - require => Repository["${dotfiles}"] | |
| 96 | + osx_chsh { $boxen_user: | |
| 97 | + shell => '/bin/zsh' | |
| 132 | 98 | } |
| 133 | 99 | |
| 134 | - # KeyRemap4Macbook | |
| 135 | - # include keyremap4macbook | |
| 136 | - # include keyremap4macbook::login_item | |
| 137 | - # keyremap4macbook::remap { 'private.f19_to_hyper': } | |
| 138 | - # keyremap4macbook::private_xml { 'private.xml': | |
| 139 | - # source => "${dotfiles}/KeyRemap4MacBook/private.xml", | |
| 140 | - # require => Repository["${dotfiles}"] | |
| 141 | - # } | |
| 142 | - | |
| 143 | - # Seil | |
| 144 | - #include seil | |
| 145 | - #include seil::login_item | |
| 146 | - #seil::bind { 'keyboard bindings': | |
| 147 | - #mappings => { 'capslock' => 80 } | |
| 148 | - #} | |
| 149 | - | |
| 150 | - # Vagrant | |
| 151 | - #include vagrant | |
| 152 | - #vagrant::plugin { 'vagrant-vbguest': } | |
| 100 | + include dotfiles::git | |
| 101 | + include dotfiles::zsh | |
| 102 | + include dotfiles::rubygems | |
| 153 | 103 | } |
modules/people/manifests/hanjianwei/mirrors.pp
| 1 | -class people::hanjianwei::mirrors( | |
| 2 | - $home = $people::hanjianwei::config::home, | |
| 3 | - $dotfiles = $people::hanjianwei::config::dotfiles | |
| 4 | -) { | |
| 5 | - include boxen::gemrc | |
| 6 | - | |
| 7 | - File <| title == "${home}/.gemrc" |> { | |
| 8 | - source => "${dotfiles}/Gem/gemrc", | |
| 9 | - require => Repository["${dotfiles}"] | |
| 10 | - } | |
| 11 | -} |
modules/people/manifests/hanjianwei/osx.pp
| 1 | -class people::hanjianwei::osx( | |
| 2 | - $home = $people::hanjianwei::config::home, | |
| 3 | - $dotfiles = $people::hanjianwei::config::dotfiles | |
| 4 | -) { | |
| 5 | - # Zsh | |
| 6 | - osx_chsh { $boxen_user: | |
| 7 | - shell => '/bin/zsh' | |
| 8 | - } | |
| 9 | - | |
| 10 | - repository { "${home}/.zprezto": | |
| 11 | - source => 'sorin-ionescu/prezto' | |
| 12 | - } | |
| 13 | - -> | |
| 14 | - file { "${home}/.zshrc": | |
| 15 | - ensure => link, | |
| 16 | - target => "${dotfiles}/Zsh/zshrc", | |
| 17 | - require => Repository["${dotfiles}"] | |
| 18 | - } | |
| 19 | - -> | |
| 20 | - file { "${home}/.zshenv": | |
| 21 | - ensure => link, | |
| 22 | - target => "${dotfiles}/Zsh/zshenv", | |
| 23 | - require => Repository["${dotfiles}"] | |
| 24 | - } | |
| 25 | - -> | |
| 26 | - file { "${home}/.zpreztorc": | |
| 27 | - ensure => link, | |
| 28 | - target => "${dotfiles}/Zsh/zpreztorc", | |
| 29 | - require => Repository["${dotfiles}"] | |
| 30 | - } | |
| 31 | - -> | |
| 32 | - file { "${home}/.zlogin": | |
| 33 | - ensure => link, | |
| 34 | - target => "${dotfiles}/Zsh/zlogin", | |
| 35 | - require => Repository["${dotfiles}"] | |
| 36 | - } | |
| 37 | - -> | |
| 38 | - file { "${home}/.zlogout": | |
| 39 | - ensure => link, | |
| 40 | - target => "${dotfiles}/Zsh/zlogout", | |
| 41 | - require => Repository["${dotfiles}"] | |
| 42 | - } | |
| 43 | - file { "${home}/.activate.sh": | |
| 44 | - ensure => link, | |
| 45 | - target => "${dotfiles}/Zsh/activate.sh", | |
| 46 | - require => Repository["${dotfiles}"] | |
| 47 | - } | |
| 48 | - | |
| 49 | - # Setup mirrors | |
| 50 | - include people::hanjianwei::mirrors | |
| 51 | - | |
| 1 | +class people::hanjianwei::osx { | |
| 52 | 2 | # OSX settings |
| 53 | 3 | include 'osx::global::expand_save_dialog' |
| 54 | 4 | include 'osx::global::tap_to_click' |
modules/people/manifests/hanjianwei/repositories.pp
| 1 | -class people::hanjianwei::repositories( | |
| 2 | - $home = $people::hanjianwei::config::home, | |
| 3 | - $dotfiles = $people::hanjianwei::config::dotfiles, | |
| 4 | - $srcdir = $people::hanjianwei::config::srcdir | |
| 5 | -) { | |
| 1 | +class people::hanjianwei::repositories { | |
| 6 | 2 | |
| 7 | - # Git | |
| 8 | - file { "${home}/.gitconfig": | |
| 9 | - target => "${dotfiles}/Git/gitconfig", | |
| 10 | - require => Repository["${dotfiles}"] | |
| 11 | - } | |
| 12 | - | |
| 13 | - # Repos | |
| 14 | - repository { "${dotfiles}": | |
| 15 | - source => 'hanjianwei/dotfiles' | |
| 16 | - } | |
| 17 | - | |
| 18 | - repository { "${srcdir}/diyao/web": | |
| 19 | - source => 'hanjianwei/diyao-web' | |
| 20 | - } | |
| 21 | 3 | } |