various improvements mostly email
[distro-setup] / distro-end
index b883fec1ce82becebcc92b6963985338508ac3d8..bc334d659261c84d032cba53e273130b6d0f90e4 100755 (executable)
@@ -54,7 +54,7 @@ popularity-contest popularity-contest/participate boolean true
 EOF
 
 ########### begin section including li ################
-pi ${p3[@]} $($src/distro-pkgs)
+pi ${p3[@]}
 
 #### desktop stuff
 case $codename_compat in
@@ -193,6 +193,11 @@ s dpkg-reconfigure -u -fnoninteractive unattended-upgrades
 # Setup daily reboots, so all unattended upgrades go into affect
 # unattended upgrades happen at 6 am + rand(60 min).
 echo '20 7 * * * root /usr/local/bin/zelous-unattended-reboot' | s dd of=/etc/cron.d/unattended-upgrade-reboot
+case $(debian-codename) in
+  flidas)
+    if [[ ! -e /usr/local/bin/checkrestart ]]; then
+      ;;
+esac
 ##### end automatic upgrades ####
 
 # office is not exposed to internet yet
@@ -609,13 +614,142 @@ esac
 
 ########### end section including li/lj ###############
 
+
+case $(debian-codename) in
+  # needed for debootstrap scripts for fai since fai requires debian
+  flidas)
+    curl http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg | s apt-key add -
+    s dd of=/etc/apt/preferences.d/flidas-xenial <<EOF
+Package: *
+Pin: release a=xenial
+Pin-Priority: -100
+
+Package: *
+Pin: release a=xenial-updates
+Pin-Priority: -100
+
+Package: *
+Pin: release a=xenial-security
+Pin-Priority: -100
+EOF
+    s dd of=/etc/apt/sources.list.d/xenial.list 2>/dev/null <<EOF
+deb http://us.archive.ubuntu.com/ubuntu/ xenial main
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main
+EOF
+
+    s apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
+    s dd of=/etc/apt/preferences.d/flidas-bionic <<EOF
+Package: *
+Pin: release a=bionic
+Pin-Priority: -100
+
+Package: *
+Pin: release a=bionic-updates
+Pin-Priority: -100
+
+Package: *
+Pin: release a=bionic-security
+Pin-Priority: -100
+EOF
+
+    # better to run btrfs-progs which matches our kernel version
+    # (note, renamed from btrfs-tools)
+    s dd of=/etc/apt/preferences.d/btrfs-progs <<EOF
+Package: btrfs-progs libzstd1
+Pin: release a=bionic
+Pin-Priority: 1005
+
+Package: btrfs-progs libzstd1
+Pin: release a=bionic-updates
+Pin-Priority: 1005
+
+Package: btrfs-progs libzstd1
+Pin: release a=bionic-security
+Pin-Priority: 1005
+EOF
+
+
+    t=$(mktemp)
+    cat >$t <<EOF
+deb http://us.archive.ubuntu.com/ubuntu/ bionic main
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-security main
+EOF
+    f=/etc/apt/sources.list.d/bionic.list
+    if ! diff -q $t $f; then
+      s cp $t $f
+      s chmod 644 $f
+      p update
+    fi
+
+    # no special reason, but its better for btrfs-progs to
+    # be closer to our kernel version
+    pi btrfs-progs
+
+    t=$(mktemp -d)
+    cd $t
+    aptitude download debootstrap/xenial
+    ex ./*
+    s cp ./usr/share/debootstrap/scripts/* /usr/share/debootstrap/scripts
+
+    s dd of=/etc/apt/preferences.d/flidas-etiona <<EOF
+Package: *
+Pin: release a=etiona
+Pin-Priority: -100
+
+Package: *
+Pin: release a=etiona-updates
+Pin-Priority: -100
+
+Package: *
+Pin: release a=etiona-security
+Pin-Priority: -100
+
+Package: *
+Pin: release a=etiona-backports
+Pin-Priority: -100
+EOF
+
+    t=$(mktemp)
+    cat >$t <<EOF
+deb http://mirror.fsf.org/trisquel/ etiona main
+deb http://mirror.fsf.org/trisquel/ etiona-updates main
+deb http://archive.trisquel.info/trisquel/ etiona-security main
+deb http://mirror.fsf.org/trisquel/ etiona-backports main
+EOF
+    f=/etc/apt/sources.list.d/etiona.list
+    if ! diff -q $t $f; then
+      s cp $t $f
+      s chmod 644 $f
+      p update
+    fi
+
+    # needed for false positive in checkrestart
+    s dd of=/etc/apt/preferences.d/debian-goodies <<EOF
+Package: debian-goodies
+Pin: release a=etiona
+Pin-Priority: 1005
+
+Package: debian-goodies
+Pin: release a=etiona-updates
+Pin-Priority: 1005
+
+Package: debian-goodies
+Pin: release a=etiona-security
+Pin-Priority: 1005
+EOF
+    ;;
+esac
+
+
 # TODO: some of the X programs can be removed from pall when using wayland
 
 # depends gcc is a way to install suggests. this is apparently the only
 # way to install suggests even if the main package is already
 # installed. reinstall doesn't work, uninstalling can cause removing
 # dependent packages.
-pi ${pall[@]} $(apt-cache search ruby[.0-9]+-doc| awk '{print $1}') $(apt-cache depends gcc|grep -i suggests:| awk '{print $2}')
+pi ${pall[@]} $(apt-cache search ruby[.0-9]+-doc| awk '{print $1}') $(apt-cache depends gcc|grep -i suggests:| awk '{print $2}') $($src/distro-pkgs)
 
 if ! type pip; then
   x=$(mktemp)
@@ -977,119 +1111,6 @@ case $distro in
   # others unknown
 esac
 
-case $(debian-codename) in
-  # needed for debootstrap scripts for fai since fai requires debian
-  flidas)
-    curl http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg | s apt-key add -
-    s dd of=/etc/apt/preferences.d/flidas-xenial <<EOF
-Package: *
-Pin: release a=xenial
-Pin-Priority: -100
-
-Package: *
-Pin: release a=xenial-updates
-Pin-Priority: -100
-
-Package: *
-Pin: release a=xenial-security
-Pin-Priority: -100
-EOF
-    s dd of=/etc/apt/sources.list.d/xenial.list 2>/dev/null <<EOF
-deb http://us.archive.ubuntu.com/ubuntu/ xenial main
-deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main
-deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main
-EOF
-
-    s apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
-    s dd of=/etc/apt/preferences.d/flidas-bionic <<EOF
-Package: *
-Pin: release a=bionic
-Pin-Priority: -100
-
-Package: *
-Pin: release a=bionic-updates
-Pin-Priority: -100
-
-Package: *
-Pin: release a=bionic-security
-Pin-Priority: -100
-EOF
-
-    # better to run btrfs-progs which matches our kernel version
-    # (note, renamed from btrfs-tools)
-    s dd of=/etc/apt/preferences.d/btrfs-progs <<EOF
-Package: btrfs-progs libzstd1
-Pin: release a=bionic
-Pin-Priority: 1005
-
-Package: btrfs-progs libzstd1
-Pin: release a=bionic-updates
-Pin-Priority: 1005
-
-Package: btrfs-progs libzstd1
-Pin: release a=bionic-security
-Pin-Priority: 1005
-EOF
-
-
-    t=$(mktemp)
-    cat >$t <<EOF
-deb http://us.archive.ubuntu.com/ubuntu/ bionic main
-deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main
-deb http://us.archive.ubuntu.com/ubuntu/ bionic-security main
-EOF
-    f=/etc/apt/sources.list.d/bionic.list
-    if ! diff -q $t $f; then
-      s cp $t $f
-      s chmod 644 $f
-      p update
-    fi
-
-    # no special reason, but its better for btrfs-progs to
-    # be closer to our kernel version
-    pi btrfs-progs
-
-    t=$(mktemp -d)
-    cd $t
-    aptitude download debootstrap/xenial
-    ex ./*
-    s cp ./usr/share/debootstrap/scripts/* /usr/share/debootstrap/scripts
-
-    s dd of=/etc/apt/preferences.d/flidas-etiona <<EOF
-Package: *
-Pin: release a=etiona
-Pin-Priority: -100
-
-Package: *
-Pin: release a=etiona-updates
-Pin-Priority: -100
-
-Package: *
-Pin: release a=etiona-security
-Pin-Priority: -100
-
-Package: *
-Pin: release a=etiona-backports
-Pin-Priority: -100
-EOF
-
-    t=$(mktemp)
-    cat >$t <<EOF
-deb http://mirror.fsf.org/trisquel/ etiona main
-deb http://mirror.fsf.org/trisquel/ etiona-updates main
-deb http://archive.trisquel.info/trisquel/ etiona-security main
-deb http://mirror.fsf.org/trisquel/ etiona-backports main
-EOF
-    f=/etc/apt/sources.list.d/etiona.list
-    if ! diff -q $t $f; then
-      s cp $t $f
-      s chmod 644 $f
-      p update
-    fi
-
-    ;;
-esac
-
 # /run and /dev/shm are listed as required for pulseaudio. All 4 in the group
 # listed in the default config as suggested.
 # /run/usr/1000 i noticed was missing for pulseaudio
@@ -1686,11 +1707,15 @@ if ! type -p guix >/dev/null; then
   # manual instructions
   # wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg --import -
   # echo is to get past prompt
-  echo | sudo -E HOME=/home/iank bash guix-install.sh
+  yes | sudo -E HOME=$HOME bash guix-install.sh || [[ $? == 141 ]]
   guix install glibc-utf8-locales
   guix package --install guile
 fi
 
+# install rust
+curl https://sh.rustup.rs -sSf | bash -s -- -y
+cargo install ripgrep
+
 #### tor
 case $distro in
   # based on
@@ -1762,16 +1787,12 @@ make sure to reload the firewall to load the persistent configuration
 
 EOF
     pi nfs-utils
-    sgo nfs-server
     ;;
   debian|trisquel|ubuntu)
-    pi nfs-server
+    pi-nostart nfs-server
     ;;
   arch)
     pi nfs-utils || pending_reboot=true
-    sgo rpcbind
-    # this failed until I rebooted
-    sgo nfs-server
     ;;
 esac