]> git.wh0rd.org Git - home.git/commitdiff
crostini-vapier-setup: add more packages & simplify a little
authorMike Frysinger <vapier@gentoo.org>
Thu, 24 Sep 2020 04:18:20 +0000 (00:18 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 24 Sep 2020 04:18:20 +0000 (00:18 -0400)
.bin/crostini-vapier-setup

index a2a6529d879c9883c3b74e5654529ac9ef93a1dd..0afcd107a6d7206b8fb86e848a689594fed2afc4 100755 (executable)
@@ -1,4 +1,14 @@
-#!/bin/bash
+#!/bin/bash -ex
+
+if [[ $# -ne 0 ]]; then
+       echo "Usage: $0"
+       exit 1
+fi
+
+if [[ ${UID} -ne 0 ]]; then
+       exec sudo "$0" "$@"
+fi
+
 pkgs=(
        ipython
        ipython3
@@ -18,6 +28,7 @@ pkgs=(
        gimp
        inkscape
        mpv
+       sshfs
        steam
 
        autoconf
@@ -34,12 +45,13 @@ pkgs=(
        dnsutils
        flex
        gcc
+       gdb
        gettext
        g++
        git
        git-email
        git-svn
-       gdb
+       gnupg
        keychain
        libtool
        mosh
@@ -54,8 +66,11 @@ pkgs=(
        subversion
        texinfo
        tree
+       unrar
+       unzip
        vim
        zeal
+       zip
 
        openjdk-11-jre-headless
 
@@ -73,34 +88,34 @@ pkgs=(
        pkg-config
        zlib1g-dev
 )
-exec sudo bash -c '
-set -ex
-printf "Defaults !tty_tickets\nDefaults timestamp_timeout=360\n" > /etc/sudoers.d/vapier
+
+printf "Defaults !tty_tickets\nDefaults timestamp_timeout=360\n" >/etc/sudoers.d/vapier
 chmod 440 /etc/sudoers.d/vapier
 
 # Add non-free sources for Steam.
 sed -i "/^deb .*\/debian .* main$/s:$: contrib non-free:" /etc/apt/sources.list
 dpkg --add-architecture i386
 
-curl "https://dl-ssl.google.com/linux/linux_signing_key.pub" | apt-key add -
+curl -s "https://dl-ssl.google.com/linux/linux_signing_key.pub" | apt-key add -
 echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >/etc/apt/sources.list.d/google-chrome.list
 
+curl -s "https://packages.cloud.google.com/apt/doc/apt-key.gpg" | apt-key add -
+echo "deb [arch=amd64] https://packages.cloud.google.com/apt cloud-sdk main" >/etc/apt/sources.list.d/google-cloud-sdk.list
+
 apt-get update
-apt-get dist-upgrade
+apt-get -y dist-upgrade
 
-apt-get -y install google-chrome-stable "$@"
+apt-get -y install google-chrome-stable google-cloud-sdk
 
 ln -sf ~vapier/.profile.d/ROOT-bash_profile ~root/.bash_profile
 for f in .gitconfig .inputrc .nanorc ; do
        ln -sf ~vapier/${f} ~root/${f}
 done
 rm -f ~root/.profile ~root/.bashrc
-echo . ~vapier/.profile.d/ROOT-bashrc > ~root/.bashrc
+echo . ~vapier/.profile.d/ROOT-bashrc >~root/.bashrc
 
 rm -f /etc/motd
-echo "[crostini]" > /etc/ps1_append
+echo "[crostini]" >/etc/ps1_append
 
 rm -f /etc/ssh/sshd_not_to_be_run
 /usr/sbin/sshd
-
-' bash "${pkgs[@]}"