From fe084704fe16366028cae4656ad5f440c145c720 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Thu, 28 Dec 2023 01:14:23 -0500 Subject: updated channels --- deploy.sh | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'deploy.sh') diff --git a/deploy.sh b/deploy.sh index f27d6c9..5971681 100755 --- a/deploy.sh +++ b/deploy.sh @@ -2,7 +2,7 @@ gather_env() { # Gather needed information - echo -n "Type 'e' for encrypted or 'd' for decrypted install: " + echo -n "Type 'eb' for encrypted w/ boot, 'en' for encrypted w/o boot, or 'd' for decrypted install: " read install_type echo -n "Type system hostname: " @@ -17,6 +17,13 @@ gather_env() { echo -n "Type device file for SWAP: " read swap_dev + echo -n "Add local device on network as substitute server? (y/n): " + read add_local_sub + if [ "$add_local_sub" == "y" ] + then + echo -n "Enter IP address of server: " + read substitute_ip + fi } copy_and_prepare() { @@ -37,14 +44,14 @@ copy_and_prepare() { # We are installing! # Copy template to root of repo - if [ "$install_type" == "e" ] + if [ "$install_type" == "eb" ] then cp ./modules/ryan-config/deploy-templates/HostTemplateEncrypted ./$install_hostname.scm elif [ "$install_type" == "d" ] then cp ./modules/ryan-config/deploy-templates/HostTemplate ./$install_hostname.scm else - echo "Invalid install type (not d or e), bailing!" + echo "Invalid install type (not eb, en, or d), bailing!" exit 1 fi @@ -62,11 +69,24 @@ copy_and_prepare() { echo "Installing non-guix signing keys for substitutes..." curl -o sign-key.pub https://substitutes.nonguix.org/signing-key.pub guix archive --authorize < sign-key.pub + + if [ "$add_local_sub" == "y" ] + then + echo "Installing local substitute server's signing keys" + curl -o local-sign.pub http://$substitute_ip/signing-key.pub + guix archive --authorize < local-sign.pub + fi } install_system() { echo "Beginning install!" - guix time-machine -C ./channels.scm -- system -L ./modules --substitute-urls='https://substitutes.nonguix.org https://bordeaux.guix.gnu.org https://ci.guix.gnu.org' init $install_hostname.scm /mnt + if [ "$add_local_sub" == "y"] + then + guix time-machine -C ./channels.scm -- system -L ./modules --substitute-urls="http://$substitute_ip https://substitutes.nonguix.org https://bordeaux.guix.gnu.org https://ci.guix.gnu.org" init $install_hostname.scm /mnt + else + guix time-machine -C ./channels.scm -- system -L ./modules --substitute-urls="https://substitutes.nonguix.org https://bordeaux.guix.gnu.org https://ci.guix.gnu.org" init $install_hostname.scm /mnt + fi + } install_user_env() { -- cgit v1.2.3