summaryrefslogtreecommitdiff
path: root/deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'deploy.sh')
-rwxr-xr-xdeploy.sh48
1 files changed, 43 insertions, 5 deletions
diff --git a/deploy.sh b/deploy.sh
index 8de8177..4d9df96 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -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
69install_system() { 69install_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
74install_user_env() { 74install_user_env() {
@@ -90,16 +90,54 @@ if [[ $* == *-p ]]
90then 90then
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
98elif [[ $* == *-i ]] 98elif [[ $* == *-i ]]
99then 99then
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
103fi 141fi
104 142
105gather_env 143gather_env