-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
166 lines (132 loc) · 4.54 KB
/
Makefile
File metadata and controls
166 lines (132 loc) · 4.54 KB
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
SHELL = /bin/zsh
PLATFORM := $(shell uname -s)
ifeq ("${PLATFORM}", "Darwin")
VSCODE_CONFIG_DIR := ${HOME}/Library/Application Support/Code/User
config: \
config-common \
configure-desktop-macos
install: \
install-brew-packages \
install-scripts
else ifeq ("${PLATFORM}", "Linux")
VSCODE_CONFIG_DIR := ${HOME}/.config/Code/User
config: \
config-common \
configure-abcde \
configure-apt \
configure-desktop-gnome \
configure-flatpak \
configure-libvirt \
configure-pam-limits \
configure-sysctl \
configure-timedatectl \
configure-vagrant
install: \
install-apt-packages \
install-scripts
endif
config-common: \
configure-ack \
configure-git \
configure-ideavim \
configure-mpv \
configure-sqlite3 \
configure-ssh \
configure-tmux \
configure-vim \
configure-vscode \
configure-zsh
# Configuration targets
configure-abcde:
# Configure abcde
ln -f -s ${PWD}/config/abcde/abcde.conf ${HOME}/.abcde.conf
configure-ack:
# Configure Ack
ln -f -s ${PWD}/config/ack/ackrc ${HOME}/.ackrc
configure-apt:
# Configure APT
sudo ln -f -s ${PWD}/config/apt/local /etc/apt/apt.conf.d/99local
configure-desktop-gnome:
# Disable updates in GNOME Software
gsettings set org.gnome.software allow-updates false
gsettings set org.gnome.software download-updates false
gsettings set org.gnome.software download-updates-notify false
configure-desktop-macos:
# Set delay for hot corners
defaults write com.apple.dock wvous-corner-action-delay -float 0.2
configure-flatpak:
# Add Flathub repo for Flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
configure-git:
# Configure Git
ln -f -s ${PWD}/config/git/gitconfig ${HOME}/.gitconfig
ln -f -s ${PWD}/config/git/gitignore ${HOME}/.gitignore
configure-ideavim:
# Configure IdeaVim
ln -f -s ${PWD}/config/ideavim/ideavimrc ${HOME}/.ideavimrc
configure-libvirt:
# Add current user to `libvirt` group
getent group libvirt || sudo groupadd libvirt
sudo usermod --append --groups libvirt ${USER}
configure-mpv:
# Configure mpv
mkdir -p ${HOME}/.config/mpv
ln -f -s ${PWD}/config/mpv/mpv.conf ${HOME}/.config/mpv/mpv.conf
mkdir -p ${HOME}/.config/mpv/script-opts
ln -f -s ${PWD}/config/mpv/script-opts/osc.conf ${HOME}/.config/mpv/script-opts/osc.conf
configure-pam-limits:
# Set resource limits for `audio` group
sudo cp ${PWD}/config/pam_limits/audio.conf /etc/security/limits.d/95-audio.conf
# Add current user to `audio` group
getent group audio || sudo groupadd audio
sudo usermod --append --groups audio ${USER}
configure-sqlite3:
# Configure SQLite3
ln -f -s ${PWD}/config/sqlite3/sqliterc ${HOME}/.sqliterc
SSH_INCLUDE_LINE := "Include ${PWD}/config/ssh/config"
configure-ssh:
# Configure SSH
mkdir -p ${HOME}/.ssh/
if [[ ! -f ${HOME}/.ssh/config ]]; then touch ${HOME}/.ssh/config; fi
grep --line-regexp --fixed-strings --quiet -- ${SSH_INCLUDE_LINE} ${HOME}/.ssh/config || printf '\n%s\n' ${SSH_INCLUDE_LINE} >> ${HOME}/.ssh/config
configure-sysctl:
# Configure sysctl settings
sudo cp ${PWD}/config/sysctl/local.conf /etc/sysctl.d/local.conf
configure-timedatectl:
# Configure system time to be UTC
sudo timedatectl set-local-rtc 0
configure-tmux:
# Configure tmux
ln -f -s ${PWD}/config/tmux/tmux.conf ${HOME}/.tmux.conf
configure-vagrant:
# Configure sudoers for Vagrant
getent group vagrant || sudo groupadd vagrant
sudo usermod --append --groups vagrant ${USER}
sudo cp ${PWD}/config/vagrant/sudoers /etc/sudoers.d/vagrant
sudo chown root:root /etc/sudoers.d/vagrant
configure-vim:
# Configure Vim
ln -f -s ${PWD}/config/vim/vimrc ${HOME}/.vimrc
configure-vscode:
# Configure VS Code
mkdir -p "${VSCODE_CONFIG_DIR}"
ln -f -s ${PWD}/config/vscode/settings.json "${VSCODE_CONFIG_DIR}/settings.json"
# Disable key press and hold for VSCode under MacOS
if [[ "${PLATFORM}" = "Darwin" ]]; then defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false; fi
configure-zsh:
# Configure zsh
ln -f -s ${PWD}/config/zsh/zprofile ${HOME}/.zprofile
ln -f -s ${PWD}/config/zsh/zshrc ${HOME}/.zshrc
# Installation targets
install-apt-packages:
# Install APT packages
xargs --arg-file=<(grep --invert-match "^#" install/apt-packages.txt) --no-run-if-empty -- sudo apt-get install --yes
install-brew-packages:
# Install Brew packages
brew bundle install --file=install/Brewfile
install-scripts:
# Link dash scripts
sudo mkdir -p /usr/local/bin/
sudo ln -f -s ${PWD}/scripts/dvdextract.sh /usr/local/bin/dvdextract
sudo ln -f -s ${PWD}/scripts/resample.sh /usr/local/bin/resample
sudo ln -f -s ${PWD}/scripts/sanitize.sh /usr/local/bin/sanitize