-
Notifications
You must be signed in to change notification settings - Fork 0
/
debbie.sh
executable file
·738 lines (658 loc) · 19.2 KB
/
debbie.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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
#! /bin/bash -eu
# Set up a Debian / Ubuntu machine to my liking.
# Put it all in a single file, so that it can be curl'd.
## OUTLINE
# debbie defines a set of "features" that we may / may not want to run.
# Each "feature" ties in to "stages", which are:
# - Install dependencies (including Apt repositories)
# - Install & update pre-built binaries
# - Test and/or build pinned software (i.e. stuff that's built from source)
#
# All the available functions go into stage tables,
# PREPARE[$feature], INSTALL[$feature], and BUILD[$feature].
# Usually the function in the table will be something like debbie::${feature}::${stage},
# but some share implementations (e.g. util::noop).
#
# Features can be toggled on and off by +feature -feature on the command line.
declare -A PREPARE
declare -A INSTALL
declare -A BUILD
declare -A FEATURES
export PREPARE INSTALL BUILD FEATURES
DEFAULT_FEATURES="+update +core +build +home +tmux"
util::all_features() {
for feature in "${!PREPARE[@]}"
do
echo -n "${feature} "
done
}
util::help() {
cat <<EOF
$1: bootstrap a system to cceckman's liking
debbie.sh is a (Bash) shell script that configures a Debian system with stuff
@cceckman finds useful.
It contains a number of "features", which can be toggled on or off with
arguments like "+feature" or "-feature". The default options are given below;
feature names are (mostly) self-describing.
Default features:
$DEFAULT_FEATURES
Available features:
$(util::all_features)
EOF
exit -1
}
main() {
local INPUT_FEATURES="$DEFAULT_FEATURES $*"
declare -a FEATURES
FEATURES=()
local ERR="false"
for flag in $INPUT_FEATURES
do
local tag="${flag:0:1}"
local feature="${flag:1}"
# Special cases first:
case "$flag" in
'+all')
for feature in $(util::all_features);
do
for existing_feature in "${FEATURES[@]}"
do
if test "$existing_feature" = "$feature"
then
continue 2
fi
done
FEATURES+=("$feature")
done
continue
;;
'-all') FEATURES=(); continue;;
*help) util::help "$0";;
esac
case "$tag" in
'+') for existing_feature in "${FEATURES[@]}"
do
if test "$existing_feature" = "$feature"
then
continue 2
fi
done
FEATURES+=("$feature")
;;
'-') declare -a newFeatures
for existing_feature in "${FEATURES[@]}"
do
if test "$existing_feature" != "$feature"
then
newFeatures+=("$existing_feature")
fi
done
FEATURES=("${newFeatures[@]}")
;;
*) echo >&2 "Unrecognized operation $tag in $flag; must be '+' or '-'"
ERR="true"
;;
esac
done
for feature in "${FEATURES[@]}"
do
# We can't loop through here because treating it like a nested array goes poorly.
if ! test "$(type -t "${PREPARE[$feature]}")" == "function"
then
ERR="true"
echo >&2 "Unknown stage/feature combination: 'PREPARE ${feature}'"
fi
if ! test "$(type -t "${INSTALL[$feature]}")" == "function"
then
ERR="true"
echo >&2 "Unknown stage/feature combination: 'INSTALL ${feature}'"
fi
if ! test "$(type -t "${BUILD[$feature]}")" == "function"
then
ERR="true"
echo >&2 "Unknown stage/feature combination: 'BUILD ${feature}'"
fi
done
if "$ERR"; then exit 1; fi
# Some features have interdependencies, e.g. bazel depends on go.
# TODO: Remove the interdependencies, or enforce them.
# We've validated that each feature & stage exists.
# Do some general checking:
util::preflight
# and run each stage.
for feature in "${FEATURES[@]}"
do
echo "Preparing $feature..."
"${PREPARE[$feature]}"
done
for feature in "${FEATURES[@]}"
do
echo "Installing $feature..."
"${INSTALL[$feature]}"
done
for feature in "${FEATURES[@]}"
do
echo "Building $feature..."
"${BUILD[$feature]}"
done
echo "All done!"
}
VERSION_CODENAME="$(env -i bash -c '. /etc/os-release; echo $VERSION_CODENAME')"
# Some preflight checks that should run before any module.
util::preflight() {
for tool in sudo apt-get
do
if ! command -v "$tool" >/dev/null
then
echo >&2 "Could not find required tool $tool"
exit 1
fi
done
if [ "$USER" = "root" ]
then
echo >&2 "Don't run this as root!"
echo >&2 "Just run as yourself; debbie will ask for sudo permission when needed."
exit 1
else
echo "Prompting for sudo mode..."
sudo true
fi
}
util::getver() {
echo -n "$@" | grep -o '[0-9][0-9a-z]*\.[0-9][0-9a-z]*\(\.[0-9][0-9a-z]*\)\?'
}
util::vergte() {
lesser="$(echo -e "$(util::getver "$1")\\n$(util::getver "$2")" | sort -V | head -n1)"
[ "$1" = "$lesser" ]
}
util::noop() {
return
}
util::install_packages() {
sudo \
DEBIAN_FRONTEND=noninteractive \
apt-get -yq --no-install-recommends \
install "$@"
}
## update
debbie::update::prepare() {
# "prepare" steps are usually installing new repositories.
# Make sure there's a directory to install into.
if ! test -d /etc/apt/sources.list.d
then
mkdir -m 0755 /etc/apt/sources.list.d
fi
# And make sure they can get the right release & keys when adding
# the repositories.
# They can rely on https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html
# (e.g. `tee`, `grep`), `apt` (assume Debian), and `sudo` (assume it's installed),
# but these are still needed.
util::install_packages lsb-release curl gnupg2 software-properties-common
}
debbie::update::install() {
sudo apt-get update
sudo apt-get upgrade -y
}
PREPARE[update]=debbie::update::prepare
INSTALL[update]=debbie::update::install
BUILD[update]=util::noop
## core:
## I want these packages everywhere, including on lightweight/temp remotes.
debbie::core::install() {
util::install_packages \
arping \
bash \
bc \
dnsutils \
fping \
git \
htop \
ipcalc \
locales \
mtr \
net-tools \
netcat \
psmisc \
python3 \
ripgrep \
rsync \
socat \
ssh \
tcpdump \
traceroute \
vim \
whois \
zip unzip \
zsh
}
debbie::core::build() {
# Set locale to US
if ! locale | grep -q 'LANG=en_US.UTF-8'
then
# Set locale to US.
sudo sed -i -e 's/^[^#]/# \0/' -e 's/^.*\(en_US.UTF-8\)/\1/' /etc/locale.gen
sudo /usr/sbin/locale-gen
fi
}
PREPARE[core]=util::noop
INSTALL[core]=debbie::core::install
BUILD[core]=debbie::core::build
## build: packages used to build / debug other things
debbie::build::prepare() {
# Use LLVM project's repos for Clang, to stay up to date
# https://apt.llvm.org/
cat <<SOURCES | sudo tee /etc/apt/sources.list.d/llvm.list
# 12
deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-13 main
deb-src http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-13 main
SOURCES
curl -Lo- https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-get update
}
debbie::build::install() {
util::install_packages \
autoconf \
clang \
clang \
clang-format \
clang-tidy \
devscripts \
dosfstools \
gdb \
graphviz \
jq \
libclang-dev \
libnotify-bin \
lld \
llvm \
make \
manpages-dev \
mlocate \
ntfs-3g \
parallel \
parted \
pcscd \
pkg-config \
python3-pip \
sbuild \
software-properties-common \
# PIP packages as well
python3 -m pip install --user wheel setuptools
python3 -m pip install --user pyyaml pathspec yamllint
}
PREPARE[build]=debbie::build::prepare
INSTALL[build]=debbie::build::install
BUILD[build]=util::noop
## graphical
debbie::graphical::install() {
util::install_packages \
chromium \
chromium-sandbox \
cmatrix \
curl \
dmenu \
i3 \
i3status \
konsole \
libanyevent-i3-perl \
redshift \
scdaemon \
unzip \
vim-gtk \
wireshark \
xbacklight \
xclip \
xorg \
xss-lock \
xterm \
yubikey-personalization
debbie::graphical::install::firacode
fc-cache -f
}
### Helper for installing fonts.
### TODO: Include IBM Plex as well
debbie::graphical::install_font() {
fonts_dir="${HOME}/.local/share/fonts"
mkdir -p "$fonts_dir"
TDIR="$(mktemp -d)"
unzip "$1" -d "$TDIR" '**.ttf'
mv -f "$TDIR/*.ttf" "$fonts_dir"
rm -rf "$TDIR"
}
### Firacode helper for graphical target.
debbie::graphical::install::firacode() {
FIRA_VNO="5.2"
# Check presence...
if FONT=$(fc-list | grep -o '[^ ]*FiraCode-Regular.ttf')
then
# Check version.
FONTVERSION="$(fc-query -f '%{fontversion}' $FONT)"
# Convert fixed-point to string float
FONTVERSION="$(echo "scale=3; $FONTVERSION / 65536.0" | bc)"
# Convert fixed-point to a string expression
ISGTE="$(echo "scale=3; $FONTVERSION >= $FIRA_VNO" | bc)"
if test "$ISGTE" -eq 1
then
echo "No update needed to Fira Code"
echo "(version $FONTVERSION >= $FIRA_VNO)"
return
fi
fi
TDIR="$(mktemp -d)"
curl -Lo "$TDIR/firacode.zip" \
"https://github.com/tonsky/FiraCode/releases/download/$FIRA_VNO/Fira_Code_v${FIRA_VNO}.zip"
debbie::graphical::install_font "$TDIR/firacode.zip"
}
PREPARE[graphical]=util::noop
INSTALL[graphical]=debbie::graphical::install
BUILD[graphical]=util::noop
## displaymanager
## A lower-level than graphical; e.g. starting from minbase.
debbie::displaymanager::prepare() {
cat <<SRC | sudo tee /etc/apt/sources.list.d/deb-nonfree.list
deb http://deb.debian.org/debian non-free contrib
deb-src http://deb.debian.org/debian ${VERSION_CODENAME} non-free contrib
SRC
}
debbie::displaymanager::install() {
util::install_packages \
lightdm \
nvidia-driver \
linux-headers-$(uname -r)
}
PREPARE[displaymanager]=debbie::displaymanager::prepare
INSTALL[displaymanager]=debbie::displaymanager::install
BUILD[displaymanager]=util::noop
## home
debbie::home::install() {
util::install_packages git zsh
pushd "$HOME"
{
if ! test -d ".git"
then
git clone https://github.com/cceckman/Tilde.git
mv Tilde/.git .
rm -rf Tilde
git reset --hard
git submodule update --recursive --init
fi
# Leave the pull URL as http, but set the push URL to SSH.
# This allows us to continue to pull from a host without SSH keys for the remote.
if test "$(git remote get-url --push origin)" = "https://github.com/cceckman/Tilde.git"
then
git remote set-url --push origin [email protected]:cceckman/Tilde.git
fi
}
popd
}
debbie::home::build() {
# Use `sudo` so it doesn't prompt to enter $USER's password againa
sudo chsh -s "$(command -v zsh)" "$USER"
# Create undo & swap Vim directories, to keep tem out of the working dirs
mkdir -p "$HOME/.vim/swap" "$HOME/.vim/undo"
}
PREPARE[home]=util::noop
INSTALL[home]=debbie::home::install
BUILD[home]=debbie::home::build
## gcloud
debbie::gcloud::prepare() {
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update
}
debbie::gcloud::install() {
util::install_packages google-cloud-sdk kubectl google-cloud-sdk-app-engine-go
}
PREPARE[gcloud]=debbie::gcloud::prepare
INSTALL[gcloud]=debbie::gcloud::install
BUILD[gcloud]=util::noop
## docker
debbie::docker::prepare() {
if ! grep -Rq "download.docker.com" /etc/apt/sources.list /etc/apt/sources.list.d
then
curl -fsSL https://download.docker.com/linux/debian/gpg \
| sudo apt-key add -v - 2>&1 \
| grep 8D81803C0EBFCD88 \
|| {
echo >&2 "Bad key for Docker!"
exit 1
}
echo "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
fi
}
debbie::docker::install() {
util::install_packages docker-ce docker-ce-cli containerd.io
}
debbie::docker::build() {
sudo groupadd -f docker
sudo gpasswd -a "$USER" docker
}
PREPARE[docker]=debbie::docker::prepare
INSTALL[docker]=debbie::docker::install
BUILD[docker]=debbie::docker::build
## bazel
debbie::bazel::prepare() {
# TODO: Add utils:: to align with docker, gcloud; verify key
if ! grep -Rq "https://storage.googleapis.com/bazel-apt" /etc/apt/sources.list /etc/apt/sources.list.d
then
echo "deb https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
fi
sudo apt-get update
}
debbie::bazel::install() {
util::install_packages bazel
}
debbie::bazel::build() {
set -x
go get -u github.com/bazelbuild/buildtools/buildifier
set +x
IBAZEL_VNO="0.15.10"
if command -v ibazel >/dev/null && util::vergte "$IBAZEL_VNO" "$(ibazel 2>&1 | head -1 | grep -o '[^v]*$')"
then
return
fi
# Manual install of ibazel
mkdir -p "$HOME/bin"
pushd /tmp
{
rm -rf ibazel
git clone --depth=1 git://github.com/bazelbuild/bazel-watcher ibazel
cd ibazel
bazel build //ibazel
cp bazel-bin/ibazel/*_stripped/ibazel "$HOME/bin/ibazel"
chmod 0744 "$HOME/bin/ibazel" # allow later rewriting, e.g. upgrade
}
popd
}
PREPARE[bazel]=debbie::bazel::prepare
INSTALL[bazel]=debbie::bazel::install
BUILD[bazel]=debbie::bazel::build
## tmux
debbie::tmux::build() {
TMUX_VNO="3.3a"
if command -v tmux >/dev/null && util::vergte "$TMUX_VNO" "$(tmux -V)"
then
echo "Have tmux $(tmux -V), skipping build"
return
fi
echo "Building & installing tmux $TMUX_VNO"
pushd /tmp
{
# Build dependencies; should be apt-get build-dep tmux
util::install_packages libncurses-dev automake libevent-dev bison
TMUXTAR=/tmp/tmux.tar.gz
curl -Lo $TMUXTAR https://github.com/tmux/tmux/archive/${TMUX_VNO}.tar.gz
tar -xvf $TMUXTAR
cd tmux-$TMUX_VNO
sh autogen.sh
./configure
make
sudo make install
sudo apt-get -y remove tmux
rm -rf /tmp/tmux*
}
popd
}
PREPARE[tmux]=util::noop
INSTALL[tmux]=util::noop
BUILD[tmux]=debbie::tmux::build
## golang
debbie::golang::install() {
util::install_packages vim git
GO_VNO="1.18.3"
# We don't early-exit here so that we run :GoInstallBinaries at the end
if ! (command -v go >/dev/null && util::vergte "$GO_VNO" "$(go version)")
then
declare -A GOARCH
GOARCH[x86_64]="amd64"
GOTAR=/tmp/golang.tar.gz
curl -o "$GOTAR" "https://storage.googleapis.com/golang/go${GO_VNO}.linux-${GOARCH[$(uname -m)]}.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "$GOTAR"
rm "$GOTAR"
export PATH="/usr/local/go/bin:$PATH"
else
echo "Have $(go version), skipping build"
fi
}
PREPARE[golang]=util::noop
INSTALL[golang]=debbie::golang::install
BUILD[golang]=util::noop
## ssh-target
debbie::ssh-target::install() {
util::install_packages openssh-server
}
debbie::ssh-target::build() {
# Important for useful GPG agent forwarding:
# Unbind sockets when client disconnects
SLBU="StreamLocalBindUnlink yes"
if ! test -f /etc/ssh/sshd_config || ! grep -q "$SLBU" /etc/ssh/sshd_config
then
echo "$SLBU" | sudo tee -a /etc/ssh/sshd_config >/dev/null
fi
# Disable password authentication
NOPA="PasswordAuthentication no"
NOEP="PermitEmptyPasswords no"
if ! grep -q "^$NOPA" /etc/ssh/sshd_config
then
echo "$NOPA" | sudo tee -a /etc/ssh/sshd_config >/dev/null
fi
if ! grep -q "^$NOEP" /etc/ssh/sshd_config
then
echo "$NOEP" | sudo tee -a /etc/ssh/sshd_config >/dev/null
fi
sudo systemctl restart sshd
}
PREPARE[ssh-target]=util::noop
INSTALL[ssh-target]=debbie::ssh-target::install
BUILD[ssh-target]=debbie::ssh-target::build
## rust
debbie::rust::install() {
# There are cargo and rustc packages,
# but we need access to nightly and src in order to xbuild.
pushd /tmp
{
curl https://sh.rustup.rs -sSf -o rustup.sh
chmod +x rustup.sh
./rustup.sh -y --no-modify-path
PATH="$HOME/.cargo/bin:$PATH"
rustup component add rustfmt
}
popd
}
PREPARE[rust]=util::noop
INSTALL[rust]=debbie::rust::install
BUILD[rust]=util::noop
## fomu tools
# The binaries in https://github.com/im-tomu/fomu-toolchain are gonna be
# all in the same, not-really-right place. Install / build from source instead.
debbie::fomu::install() {
# I'd like to build "hotter", i.e. from upstream, but we'll do this for now.
FOMU_VNO="1.5.6"
FOMU_HASH="0847802dfe7e8d0ee2f08989d5fc262f218b79bac01add717372777e64bd19b5"
mkdir -p "$HOME/bin"
pushd /tmp
if ! test "$(cat "$HOME/bin/fomu-toolchain/.installed")" = "$FOMU_HASH"
then
local FILE="fomu-toolchain.tar.gz"
local WORDY="fomu-toolchain-linux_x86_64-v${FOMU_VNO}"
curl -Lo "$FILE" \
"https://github.com/im-tomu/fomu-toolchain/releases/download/v${FOMU_VNO}/${WORDY}.tar.gz"
test "$FOMU_HASH" = "$(sha256sum "$FILE" | cut -d' ' -f1)"
tar -xf "$FILE"
rm -rf "$HOME/bin/fomu-toolchain"
mv "${WORDY}" "$HOME/bin/fomu-toolchain"
echo "$FOMU_HASH" >"$HOME/bin/fomu-toolchain/.installed"
fi
# Ensure we have permissions:
# {
# sudo groupadd plugdev || true
# sudo usermod -a -G plugdev "$USER" || true
# local UDEV="/etc/udev/rules.d/99-fomu.rules"
# cat >/tmp/fomu-udev-rules <<HRD
#UBSYSTEM=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="5bf0", MODE="0664", GROUP="plugdev"
#RD
# if ! { test -e "$UDEV" && test "$(cat /tmp/fomu-udev-rules)" = "$(cat "$UDEV")" ; }
# then
# # This is an OK cat! shellcheck complains about it either way!
# # shellcheck disable=SC2002
# cat /tmp/fomu-udev-rules | sudo tee "$UDEV"
# sudo udevadm control --reload-rules
# sudo udevadm trigger
# fi
# }
popd
}
# Disabled per issue #10
# PREPARE[fomu]=util::noop
# INSTALL[fomu]=debbie::fomu::install
# BUILD[fomu]=util::noop
debbie::redo::install() {
util::install_packages \
python3 mkdocs
}
debbie::redo::build(){
local REDO_VNO="0.42d"
if command -v redo && test "$(redo --version)" = "$REDO_VNO"
then
return 0
fi
pushd /tmp
{
sudo rm -rf redo
git clone https://github.com/apenwarr/redo.git \
--branch "redo-${REDO_VNO}" \
--depth=1 \
--single-branch
cd redo
./do -j"$(nproc)" test
# Instructions don't have -E, "preserve environment",
# but it looks like it's necessary if installing via sudo.
DESTDIR='' PREFIX=/usr/local sudo -E ./do -j"$(nproc)" install
}
popd
}
PREPARE[redo]=util::noop
INSTALL[redo]=debbie::redo::install
BUILD[redo]=debbie::redo::build
debbie::powershell::prepare() {
# Download the Microsoft repository GPG keys
TEMP="$(mktemp)"
VERSION="$(cut -d. -f1 /etc/debian_version)"
curl -Lo "$TEMP" https://packages.microsoft.com/config/debian/${VERSION}/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i "$TEMP"
# Update the list of products
sudo apt-get update
}
debbie::powershell::install() {
util::install_packages powershell
}
PREPARE[powershell]=debbie::powershell::prepare
INSTALL[powershell]=debbie::powershell::install
BUILD[powershell]=util::noop
## TODO: LSPs
## TODO: ctags? Removed because of the above TODO; LSPs are the new thing.
## TODO: SSH keys? I'm doing more that's rooted in one set, but there's some advice around that says I shouldn't.
main "$@"