From 3d7208853d0f7dfdee4c0aa26a65557414aea96f Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Thu, 9 May 2024 21:23:28 -0500 Subject: Shell update --- hooks/post-up/installations | 3 +-- hooks/pre-up/1-oksh | 6 ++++++ hooks/pre-up/2-nix | 8 ++++++++ hooks/pre-up/3-void | 15 +++++++++++++++ hooks/pre-up/4-mbsync | 3 +++ hooks/pre-up/mbsync | 3 --- hooks/pre-up/nix | 6 ------ hooks/pre-up/void | 15 --------------- 8 files changed, 33 insertions(+), 26 deletions(-) create mode 100755 hooks/pre-up/1-oksh create mode 100755 hooks/pre-up/2-nix create mode 100755 hooks/pre-up/3-void create mode 100755 hooks/pre-up/4-mbsync delete mode 100755 hooks/pre-up/mbsync delete mode 100755 hooks/pre-up/nix delete mode 100755 hooks/pre-up/void (limited to 'hooks') diff --git a/hooks/post-up/installations b/hooks/post-up/installations index 562bfe2..320f86d 100644 --- a/hooks/post-up/installations +++ b/hooks/post-up/installations @@ -1,3 +1,2 @@ -#!/bin/bash -set -e +#!/bin/sh xsync diff --git a/hooks/pre-up/1-oksh b/hooks/pre-up/1-oksh new file mode 100755 index 0000000..7cff998 --- /dev/null +++ b/hooks/pre-up/1-oksh @@ -0,0 +1,6 @@ +#!/bin/sh + +if ! [ -x "$(command -v mksh)" ]; then + sudo xbps-install -y mksh + chsh -s /bin/mksh +fi diff --git a/hooks/pre-up/2-nix b/hooks/pre-up/2-nix new file mode 100755 index 0000000..cfba81f --- /dev/null +++ b/hooks/pre-up/2-nix @@ -0,0 +1,8 @@ +#!/bin/mksh + +if ! [ -x "$(command -v nix)" ]; then + echo "Installing Nix" + sudo install -d -m755 -o $(id -u) -g $(id -g) /nix + curl -L https://nixos.org/nix/install | sh +fi + diff --git a/hooks/pre-up/3-void b/hooks/pre-up/3-void new file mode 100755 index 0000000..e0824c2 --- /dev/null +++ b/hooks/pre-up/3-void @@ -0,0 +1,15 @@ +#!/bin/sh + +# We'll use xpkg from xtools to find installable packages +if ! [ -x "$(command -v xpkg)" ]; then + sudo xbps-install xtools +fi + +# Set up file sync +if [ ! -f ~/repository.list ]; then + xpkg -m > ~/repository.list +fi + +if [ ! "$(cat ~/repository.list | grep 'void-repo-nonfree')" ]; then + sudo xbps-install -Sy void-repo-nonfree +fi diff --git a/hooks/pre-up/4-mbsync b/hooks/pre-up/4-mbsync new file mode 100755 index 0000000..6d58bb1 --- /dev/null +++ b/hooks/pre-up/4-mbsync @@ -0,0 +1,3 @@ +#!/bin/sh +mkdir -p ~/mail-home +mkdir -p ~/mail-work \ No newline at end of file diff --git a/hooks/pre-up/mbsync b/hooks/pre-up/mbsync deleted file mode 100755 index 6d58bb1..0000000 --- a/hooks/pre-up/mbsync +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -mkdir -p ~/mail-home -mkdir -p ~/mail-work \ No newline at end of file diff --git a/hooks/pre-up/nix b/hooks/pre-up/nix deleted file mode 100755 index 84c077e..0000000 --- a/hooks/pre-up/nix +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -if ! [ -x "$(command -v nix)" ]; then - sh <(curl -L https://nixos.org/nix/install) --no-daemon -fi - diff --git a/hooks/pre-up/void b/hooks/pre-up/void deleted file mode 100755 index 01de807..0000000 --- a/hooks/pre-up/void +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# We'll use xpkg from xtools to find installable packages -if ! [ -x "$(command -v xpkg)" ]; then - sudo xbps-install xtools -fi - -# Set up file sync -if [ ! -f ~/repository.list ]; then - xpkg -m > ~/repository.list -fi - -if [ ! "$(cat ~/repository.list | grep 'void-repo-nonfree')" ]; then - sudo xbps-install -Sy void-repo-nonfree -fi \ No newline at end of file -- cgit v1.2.3