-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRexfile
174 lines (158 loc) · 3.41 KB
/
Rexfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# vim: set ft=perl
use Rex -base;
use Rex::Commands::File;
use Rex::Commands::Fs;
use Rex::Commands::SCM;
use Rex::Commands::Service;
# XXX - sudo required for these tasks
task 'prereqs' => sub {
pkg &_packages_install(), ensure => 'present';
pkg &_packages_remove(), ensure => 'absent';
};
task 'setup_suspend' => sub {
file '/etc/sudoers.d/pm-suspend',
content => '%sudo ALL = NOPASSWD: /usr/sbin/pm-suspend';
};
task 'setup_dropbox_watches', => sub {
file "/etc/sysctl.d/20-dropbox.conf",
content => 'fs.inotify.max_user_watches=100000';
};
task 'enable_dunst' => sub {
run('mv /usr/share/dbus-1/services/org.freedesktop.Notifications.service{,.disabled}');
};
batch 'prepare', (
qw(
prereqs
setup_suspend
setup_dropbox_watches
enable_dunst
)
);
# XXX - sudo not required for these tasks
task 'setup_dropbox' => sub {
run('wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -');
symlink("$ENV{HOME}/Dropbox/bin", "$ENV{HOME}/bin");
symlink("$ENV{HOME}/Dropbox/Documents", "$ENV{HOME}/Documents");
};
task 'setup_home_dir' => sub {
for (qw(src tmp perl5 .local/share/applications .config)) {
mkdir("$ENV{HOME}/$_"), unless => "test -d $ENV{HOME}/$_";
}
};
task 'setup_dotfiles' => sub {
set repository => 'dotfiles', url => '[email protected]:schelcj/dotfiles.git', type => 'git';
checkout 'dotfiles', path => "$ENV{HOME}/.dotfiles";
};
task 'set_defaults' => sub {
run('xdg-mime default google-chrome.desktop text/html');
run('xdg-mime default google-chrome.desktop x-scheme-handler/http');
run('xdg-mime default google-chrome.desktop x-scheme-handler/https');
};
task 'setup_wallpapers' => sub {
mkdir("$ENV{HOME}/.wallpapers");
cron add => $ENV{USER}, {
minute => '*/15',
hour => '*',
day_of_month => '*',
day_of_week => '*',
command => "$ENV{HOME}/bin/change-wallpaper",
};
};
task 'setup_rtm' => sub {
run('pip install rtm');
};
sub _packages_install {
return [qw(
xscreensaver
xscreensaver-data
xscreensaver-gl
xscreensaver-gl-extra
xscreensaver-screensaver-bsod
xscreensaver-screensaver-dizzy
xscreensaver-screensaver-webcollage
tmux
most
dstat
iotop
htop
powertop
nmap
wireshark
traceroute
scrot
mc
colortail
openvpn
network-manager-openvpn
network-manager-vpnc
cifs-utils
libxml2-dev
libexpat1-dev
htmldoc
ubuntu-restricted-extras
git
vim
vim-gnome
exuberant-ctags
perl-doc
liblocal-lib-perl
libcrypt-ssleay-perl
mosh
feh
aumix-gtk
keepassx
libxss1
remmina
remmina-plugin-nx
remmina-plugin-vnc
remmina-plugin-rdp
libxinerama-dev
libxft-dev
libxss-dev
libxdg-basedir-dev
libpango1.0-dev
libdbus-1-dev
libnotify-dev
mplayer
libao-dev
libmad0-dev
libfaad-dev
libgnutls-dev
libjson0-dev
libgcrypt11-dev
smartmontools
ruby-ronn
stow
mercurial
libssl-dev
libcurl4-gnutls-dev
asciidoc
evtest
k3b
libavfilter-dev
libavformat-dev
colordiff
gpick
python-simplejson
python-parsedatetime
python-vobject
python-markdown
python-setuptools
python-pip
xpad
clipit
weather-util
inxi
redshift-gtk
rxvt-unicode
autossh
rofi
curl
pasystray
)];
}
sub _packages_remove {
return [qw(
gnome-screensaver
)];
}