-
Notifications
You must be signed in to change notification settings - Fork 7
/
install-packages
executable file
·73 lines (65 loc) · 1.34 KB
/
install-packages
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
#!/usr/bin/env bash
set -e
set -o pipefail
set -u
os="$(uname)"
expected_nix_files=(
bin/black
bin/clang-format
bin/emacs
bin/emacsclient
bin/flake8
bin/fzf
bin/git
bin/gpg
bin/htop
bin/jq
bin/python3
bin/rg
bin/sd
bin/sqlite3
bin/tmux
bin/vim
bin/wget
bin/zsh
)
nix_package_attrs=(
nixpkgs.llvmPackages_9.clang-unwrapped # for clang-format 9
nixpkgs.fzf
nixpkgs.gitAndTools.gitFull
nixpkgs.gnupg
nixpkgs.htop
nixpkgs.jq
nixpkgs.my-ninja
nixpkgs.python3
nixpkgs.python3Packages.black
nixpkgs.python3Packages.flake8
nixpkgs.ripgrep
nixpkgs.sd
nixpkgs.strager-emacs
nixpkgs.strager-vim
nixpkgs.sqlite-interactive
nixpkgs.tmux
nixpkgs.wget
nixpkgs.zsh
nixpkgs.zsh-completions
)
main() {
install_packages
verify_installed_packages
}
install_packages() {
nix-env -iA -- "${nix_package_attrs[@]}"
}
verify_installed_packages() {
local exit_code=0
for expected_file in "${expected_nix_files[@]}"; do
local expected_file_path="${HOME}/.nix-profile/${expected_file}"
if ! [ -f "${expected_file_path}" ]; then
printf 'error: file %s not found (searched %s)\n' "${expected_file}" "${expected_file_path}"
exit_code=1
fi
done
return "${exit_code}"
}
main