-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
49 lines (40 loc) · 1.19 KB
/
bootstrap.sh
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
#!/bin/bash
# TODO - Replace this with Ansible Script
$ONEP_VERSION = "v1.12.3"
$ONEP_HOST = "my.1password.ca"
function setup_keyboard {
localectl set-x11-keymap us,us,gr pc104 colemak_dh,, grp:ctrls_toggle,compose:caps
}
function setup_homebrew {
$URI = "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
/bin/bash -c "$(curl -fsSL $URI)"
}
## setup_onepassword <EMAIL>
function setup_onepassword {
$URI = "https://cache.agilebits.com/dist/1P/op/pkg/${ONEP_VERSION}/op_linux_amd64_${ONEP_VERSION}.zip"
curl --output 1p.zip $URI && unzip 1p.zip op -d .local/bin && rm 1p.zip
eval $(op signin $ONEP_HOST $1 --shorthand my)
}
## setup_chezmoi <GITHUB_USERNAME>
function setup_chezmoi {
brew install chezmoi
chezmoi init --apply $1
}
## print_usage <PROCESS_NAME>
function print_usage {
echo "$1 <1PASSWORD_EMAIL> <GITHUB_USERNAME>"
echo "This program bootstraps this dotfile's repo into your *NIX workstation."
}
## main <1PASSWORD_EMAIL> <GITHUB_USERNAME>
function main {
setup_keyboard
setup_homebrew
setup_onepassword $1
# TODO - setup vault
setup_chezmoi $2
}
if [ -z $1 -o -z $2 ]; then
print_usage $0
else
main $1 $2
fi