diff options
| author | Ryan Schanzenbacher <ryan@rschanz.org> | 2023-09-29 15:18:09 -0400 |
|---|---|---|
| committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2023-09-29 15:18:09 -0400 |
| commit | 9a6ae200dd72059cafc6d3fa59666134d438fba7 (patch) | |
| tree | 3b9051dd1677f8c03e5b69aa3dc80ed391bd8e6a /deploy.sh | |
| parent | c33fb8d0829c67a9f30f81cd84771058a09a5fe3 (diff) | |
final (\?) changes for the presentation demo
Diffstat (limited to 'deploy.sh')
| -rwxr-xr-x | deploy.sh | 48 |
1 files changed, 43 insertions, 5 deletions
| @@ -61,14 +61,14 @@ copy_and_prepare() { | |||
| 61 | # Install the non-guix signing keys | 61 | # Install the non-guix signing keys |
| 62 | echo "Installing non-guix signing keys for substitutes..." | 62 | echo "Installing non-guix signing keys for substitutes..." |
| 63 | curl -o sign-key.pub https://substitutes.nonguix.org/signing-key.pub | 63 | curl -o sign-key.pub https://substitutes.nonguix.org/signing-key.pub |
| 64 | curl -o sign-key-r.pub http://129.21.92.78:8000/signing-key.pub | 64 | curl -o sign-key-r.pub http://129.21.94.53:8000/signing-key.pub |
| 65 | guix archive --authorize < sign-key.pub | 65 | guix archive --authorize < sign-key.pub |
| 66 | guix archive --authorize < sign-key-r.pub | 66 | guix archive --authorize < sign-key-r.pub |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | install_system() { | 69 | install_system() { |
| 70 | echo "Beginning install!" | 70 | echo "Beginning install!" |
| 71 | guix time-machine -C ./channels.scm -- system -L ./modules --substitute-urls='http://129.21.92.78:8080/ https://substitutes.nonguix.org https://bordeaux.guix.gnu.org https://ci.guix.gnu.org' init $install_hostname.scm /mnt | 71 | guix time-machine -C ./channels.scm -- system -L ./modules --substitute-urls='http://129.21.94.53:8080/ https://substitutes.nonguix.org https://bordeaux.guix.gnu.org https://ci.guix.gnu.org' init $install_hostname.scm /mnt |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | install_user_env() { | 74 | install_user_env() { |
| @@ -90,16 +90,54 @@ if [[ $* == *-p ]] | |||
| 90 | then | 90 | then |
| 91 | echo "Installing non-guix signing keys for substitutes..." | 91 | echo "Installing non-guix signing keys for substitutes..." |
| 92 | curl -o sign-key.pub https://substitutes.nonguix.org/signing-key.pub | 92 | curl -o sign-key.pub https://substitutes.nonguix.org/signing-key.pub |
| 93 | #curl -o sign-key-r.pub http://129.21.92.78:8000/signing-key.pub | 93 | curl -o sign-key-r.pub http://129.21.94.53:8000/signing-key.pub |
| 94 | #guix archive --authorize < sign-key.pub | 94 | guix archive --authorize < sign-key.pub |
| 95 | #guix archive --authorize < sign-key-r.pub | 95 | guix archive --authorize < sign-key-r.pub |
| 96 | guix time-machine -C ./channels.scm -- pull | 96 | guix time-machine -C ./channels.scm -- pull |
| 97 | exit 0 | 97 | exit 0 |
| 98 | elif [[ $* == *-i ]] | 98 | elif [[ $* == *-i ]] |
| 99 | then | 99 | then |
| 100 | gather_env | 100 | gather_env |
| 101 | # Associate devs with uuids | ||
| 102 | root_uuid=`blkid $root_dev | awk -F\" '{print $2}'` | ||
| 103 | boot_uuid=`blkid $boot_dev | awk -F\" '{print $2}'` | ||
| 104 | swap_uuid=`blkid $swap_dev | awk -F\" '{print $2}'` | ||
| 105 | # Let's a go! | ||
| 106 | echo "Information gathered. Deploying Guix on $root_dev ($root_uuid) with boot on $boot_dev ($boot_uuid) and swap on $swap_dev ($swap_uuid)" | ||
| 107 | echo -n "Proceed? (y/n): " | ||
| 108 | read install_choice | ||
| 109 | |||
| 110 | if [ "$install_choice" != "y" ] | ||
| 111 | then | ||
| 112 | echo "Bailing!" | ||
| 113 | exit 1 | ||
| 114 | fi | ||
| 115 | |||
| 116 | # We are installing! | ||
| 117 | # Copy template to root of repo | ||
| 118 | if [ "$install_type" == "e" ] | ||
| 119 | then | ||
| 120 | cp ./modules/ryan-config/deploy-templates/HostTemplateEncrypted ./$install_hostname.scm | ||
| 121 | elif [ "$install_type" == "d" ] | ||
| 122 | then | ||
| 123 | cp ./modules/ryan-config/deploy-templates/HostTemplate ./$install_hostname.scm | ||
| 124 | else | ||
| 125 | echo "Invalid install type (not d or e), bailing!" | ||
| 126 | exit 1 | ||
| 127 | fi | ||
| 128 | |||
| 129 | # Correct the information | ||
| 130 | sed -i "s/ChangeMe_ROOT/$root_uuid/" ./$install_hostname.scm | ||
| 131 | sed -i "s/ChangeMe_BOOTEFI/$boot_uuid/" ./$install_hostname.scm | ||
| 132 | sed -i "s/ChangeMe_SWAP/$swap_uuid/" ./$install_hostname.scm | ||
| 133 | sed -i "s/ChangeMe_HOST/$install_hostname/" ./$install_hostname.scm | ||
| 134 | |||
| 135 | # Install! | ||
| 136 | echo "Mounting /gnu/store to destination disk..." | ||
| 137 | herd start cow-store /mnt | ||
| 101 | install_system | 138 | install_system |
| 102 | install_user_env | 139 | install_user_env |
| 140 | exit 0 | ||
| 103 | fi | 141 | fi |
| 104 | 142 | ||
| 105 | gather_env | 143 | gather_env |
