Skip to content

Instantly share code, notes, and snippets.

@a-warner
Forked from niw/site.pp
Created February 15, 2014 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-warner/9012490 to your computer and use it in GitHub Desktop.
Save a-warner/9012490 to your computer and use it in GitHub Desktop.
node default {
# This is required to apply some manifests since these are not using
# appropriate user, group or full path to the command.
Exec {
group => "staff",
user => $boxen_user,
path => [
"/usr/local/bin",
"/usr/bin",
"/bin",
"/usr/sbin",
"sbin"
]
}
# This is also required to apply some manifests correctly.
File {
group => "staff",
owner => $boxen_user
}
# Run all defaults command as login user.
Boxen::Osx_defaults {
user => $boxen_user
}
# NOTE OS X 10.9 Mavericks workaround
# OS X 10.9 is using cfprefsd daemon to cache preferences
# and sometimes it causes inconsistency between actual preferences and cache.
# `killall cfprefsd` tells cfprefsd to flush all cache and it will relaunch.
exec {
"/usr/bin/killall cfprefsd":
user => $boxen_user,
refreshonly => true;
}
# Use /bin/zsh as login shell.
osx_chsh {
$boxen_user:
shell => "/bin/zsh";
}
# Keyboard
class {
# Keyboard, Keyboard, Key Repeat
"osx::global::key_repeat_rate":
rate => 2;
# Keyboard, Keyboard, Delay Until Repeat
"osx::global::key_repeat_delay":
delay => 15;
}
# Keyboard, Shortcuts, Full keyboard Access, All controls
include osx::global::enable_keyboard_control_access
# Disables keyboard press-and-hold for accented characters.
include osx::global::disable_key_press_and_hold
boxen::osx_defaults {
"Keyboard, Keyboard, Use all F1, F2, etc. keys as standard function keys":
domain => NSGlobalDomain,
key => "com.apple.keyboard.fnState",
type => boolean,
value => true;
}
# Mouse and Trackpad
class {
# Trackpad, Scroll & Zoom, Scroll direction: natural
"osx::global::natural_mouse_scrolling":
enabled => false;
}
boxen::osx_defaults {
"Trackpad, Point & Click, Secondary click":
host => currentHost,
domain => NSGlobalDomain,
key => "com.apple.trackpad.enableSecondaryClick",
type => boolean,
value => true;
"Trackpad, Point & Click, Tap to click":
host => currentHost,
domain => NSGlobalDomain,
key => "com.apple.mouse.tapBehavior",
type => boolean,
value => true;
}
boxen::osx_defaults {
"Mouse, Tracking":
domain => NSGlobalDomain,
key => "com.apple.mouse.scaling",
type => float,
value => 2.5;
# Active all mouse buttons.
"Mouse, Button 1":
domain => "com.apple.driver.AppleHIDMouse",
key => "Button1",
type => integer,
value => 1;
"Mouse, Button 2":
domain => "com.apple.driver.AppleHIDMouse",
key => "Button2",
type => integer,
value => 2;
"Mouse, Button 3":
domain => "com.apple.driver.AppleHIDMouse",
key => "Button3",
type => integer,
value => 3;
"Mouse, Button 4":
domain => "com.apple.driver.AppleHIDMouse",
key => "Button4",
type => integer,
value => 4;
}
# Finder
# General, Show these items on the desktop, all
include osx::finder::show_all_on_desktop
# Show ~/Library
include osx::finder::unhide_library
boxen::osx_defaults {
"Finder, Advanced, Show all filename extensions":
domain => NSGlobalDomain,
key => "AppleShowAllExtensions",
type => boolean,
value => true,
notify => Exec["killall Finder"];
"Finder, Advanced, When performing a search":
domain => "com.apple.finder",
key => "FXDefaultSearchScope",
type => string,
value => "SCcf", # Search the Current Folder
notify => Exec["killall Finder"];
"Finder, Advanced, Show warning before changing an extension":
domain => "com.apple.finder",
key => "FXEnableExtensionChangeWarning",
type => boolean,
value => false,
notify => Exec["killall Finder"];
"Finder, Advanced, Show warning before emptying the Trash":
domain => "com.apple.finder",
key => "WarnOnEmptyTrash",
type => boolean,
value => false,
notify => Exec["killall Finder"];
}
# Dock
class {
# Size
"osx::dock::icon_size":
size => 22;
}
# Show hidden app (secret preference)
include osx::dock::dim_hidden_apps
boxen::osx_defaults {
"Dock, Magnification":
domain => "com.apple.dock",
key => "magnification",
type => boolean,
value => true,
notify => Exec["killall Dock"];
"Dock, Magnification, Size":
domain => "com.apple.dock",
key => "largesize",
type => float,
value => 32,
notify => Exec["killall Dock"];
}
# Mission Control, Hot Corners
boxen::osx_defaults {
"Mission Control, Hot Corners, Top Left":
domain => "com.apple.dock",
key => "wvous-tl-corner",
type => integer,
value => 4, # Desktop
notify => Exec["killall Dock"];
"Mission Control, Hot Corners, Top Left, Modifier":
ensure => absent,
domain => "com.apple.dock",
key => "wvous-tl-modifier",
notify => Exec["killall Dock"];
"Mission Control, Hot Corners, Bottom Left":
domain => "com.apple.dock",
key => "wvous-bl-corner",
type => integer,
value => 2, # Mission Control
notify => Exec["killall Dock"];
"Mission Control, Hot Corners, Bottom Left, Modifier":
ensure => absent,
domain => "com.apple.dock",
key => "wvous-bl-modifier",
notify => Exec["killall Dock"];
"Mission Control, Hot Corners, Top Right":
domain => "com.apple.dock",
key => "wvous-tr-corner",
type => integer,
value => 12, # Notification Center
notify => Exec["killall Dock"];
"Mission Control, Hot Corners, Top Right, Modifier":
ensure => absent,
domain => "com.apple.dock",
key => "wvous-tr-modifier",
notify => Exec["killall Dock"];
"Mission Control, Hot Corners, Bottom Right":
domain => "com.apple.dock",
key => "wvous-br-corner",
type => integer,
value => 5, # Start Screen Saver
notify => Exec["killall Dock"];
"Mission Control, Hot Corners, Bottom Right, Modifier":
ensure => absent,
domain => "com.apple.dock",
key => "wvous-br-modifier",
notify => Exec["killall Dock"];
}
# Menu Items
boxen::osx_defaults {
"Energy Saver, Show battery status in menu bar, Show Percentage":
domain => "com.apple.menuextra.battery",
key => "ShowPercent",
type => boolean,
value => true;
"Date & Time, Clock, Display the time with seconds":
domain => "com.apple.menuextra.clock",
key => "DateFormat",
type => string,
value => "EEE h:mm:ss a"; # Sun 8:35:25 PM
}
~>
# To apply menu item changes, restart SystemUIServer
exec {
"/usr/bin/killall SystemUIServer":
user => $boxen_user,
refreshonly => true;
}
# General
boxen::osx_defaults {
"General, Sidebar icon size":
domain => NSGlobalDomain,
key => "NSTableViewDefaultSizeMode",
type => integer,
value => 1; # Small
"Disable window animations":
domain => NSGlobalDomain,
key => "NSAutomaticWindowAnimationsEnabled",
type => boolean,
value => false;
}
# Desktop & Screen Saver
boxen::osx_defaults {
"Desktop & Screen Saver, Screen Saver, Start after":
host => currentHost,
domain => "com.apple.screensaver",
key => "idleTime",
type => interger,
value => 600; # 10 Minutes
}
# Image Capture (iPhoto)
boxen::osx_defaults {
"Connecting camera opens, No application":
ensure => absent,
host => currentHost,
domain => "com.apple.ImageCapture2",
key => "HotPlugActionPath";
}
# Applications
include chrome::beta
include mou
include xquartz
include vagrant
package {
"Android Studio":
source => "http://dl.google.com/android/studio/install/0.3.2/android-studio-bundle-132.893413-mac.dmg",
provider => appdmg;
"AppCleaner":
source => "http://www.freemacsoft.net/downloads/AppCleaner_2.2.1.zip",
provider => compressed_app;
"AppCode":
source => "http://download.jetbrains.com/objc/AppCode-2.5.4.dmg",
provider => appdmg;
"Charles":
source => "http://www.charlesproxy.com/assets/release/3.8.3/charles-proxy-3.8.3a-applejava.dmg",
provider => appdmg_eula;
"Dropbox":
source => "https://www.dropbox.com/download?plat=mac",
provider => appdmg;
"Evernote":
source => "http://evernote.com/download/get.php?file=EvernoteMac",
provider => appdmg_eula;
"Firefox":
source => "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/25.0.1/mac/en-US/Firefox%2025.0.1.dmg",
provider => appdmg;
"IntelliJ IDEA 12":
source => "http://download.jetbrains.com/idea/ideaIU-12.1.6.dmg",
provider => appdmg;
"IntelliJ IDEA 13":
source => "http://download.jetbrains.com/idea/ideaIU-13.dmg",
provider => appdmg;
"iPhone Configuration Utility":
source => "http://support.apple.com/downloads/DL1465/en_US/iPhoneConfigUtility.dmg",
provider => pkgdmg;
"Kaleidoscope":
source => "https://updates.blackpixel.com/latest?app=ks",
flavor => zip,
provider => compressed_app;
"LimeChat":
source => "http://downloads.sourceforge.net/project/limechat/limechat/LimeChat_2.39.tbz",
provider => compressed_app;
"Lytro Desktop":
source => "https://www.lytro.com/downloads/Lytro.dmg",
provider => appdmg;
"MacVim":
source => "https://macvim-kaoriya.googlecode.com/files/macvim-kaoriya-20131126.dmg",
provider => appdmg;
"MySQLWorkbench":
source => "http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-6.0.8-osx-i686.dmg",
provider => appdmg;
"OmniGraffle":
source => "http://www.omnigroup.com/download/latest/omnigraffle",
provider => appdmg_eula;
"Postgres":
source => "http://postgresapp.com/download",
flavor => zip,
provider => compressed_app;
"Reflector":
source => "http://download.airsquirrels.com/Reflector/Mac/Reflector.dmg",
provider => appdmg;
"Reveal":
source => "http://download.revealapp.com/Reveal.app.zip",
provider => compressed_app;
"Skitch":
source => "http://evernote.com/download/get.php?file=SkitchMac",
flavor => zip,
provider => compressed_app;
"SourceTree":
source => "http://downloads.atlassian.com/software/sourcetree/SourceTree_1.8.0.3.dmg",
provider => appdmg;
"Sublime Text 2":
source => "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.dmg",
provider => appdmg;
"The Unarchiver":
source => "http://theunarchiver.googlecode.com/files/TheUnarchiver3.9.1.zip",
provider => compressed_app;
"VMware Fusion":
source => "https://download3.vmware.com/software/fusion/file/VMware-Fusion-6.0.2-1398658-light.dmg",
provider => appdmg;
"Skype":
source => "http://www.skype.com/go/getskype-macosx.dmg",
provider => appdmg;
"Google Hangout Plugin":
source => "http://dl.google.com/googletalk/googletalkplugin/GoogleVoiceAndVideoSetup.dmg",
provider => pkgdmg;
}
# Utilities
package {
"SIMBL":
source => "http://www.culater.net/dl/files/SIMBL-0.9.9.zip",
provider => compressed_pkg;
}
# Uninstall Java Applet Plugin
file {
"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin":
ensure => absent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment