aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-07-03 20:22:23 +0100
committerChristopher Baines <mail@cbaines.net>2018-07-03 20:22:23 +0100
commitb782247047f4228b9da48df67260e2c8ffea2b1a (patch)
tree5612e7ecfc5b50d8e4e828e2780fa38bed579bdd
parent85db18914af4c393fe35c6b7f8dbbff96ae969fb (diff)
downloadgovuk-mini-environment-admin-b782247047f4228b9da48df67260e2c8ffea2b1a.tar
govuk-mini-environment-admin-b782247047f4228b9da48df67260e2c8ffea2b1a.tar.gz
Copy the root profile when provisioning
Then switch to just installing guile. Also, always create the ~/.guix-profile symlink, as this isn't stored on EFS and thus needs creating everytime the machine is created.
-rw-r--r--terraform/aws/backend/main.tf8
1 files changed, 5 insertions, 3 deletions
diff --git a/terraform/aws/backend/main.tf b/terraform/aws/backend/main.tf
index 66b273b..4fb499e 100644
--- a/terraform/aws/backend/main.tf
+++ b/terraform/aws/backend/main.tf
@@ -304,12 +304,14 @@ EOF
"sudo systemctl enable guix-daemon.service",
"sudo systemctl start guix-daemon.service",
"mkdir -p ~/.config", # Make the ~/.config directory, to ensure it's owned by ubuntu
+ # Setup the profile for the ubuntu user
<<EOF
if [ ! -d "/var/guix/profiles/per-user/ubuntu" ]; then
- /var/guix/profiles/per-user/root/guix-profile/bin/guix package -i guile guix
-else
- ln -s /var/guix/profiles/per-user/ubuntu/guix-profile ~/.guix-profile
+ cp -r /var/guix/profiles/per-user/root/guix-profile-1-link /var/guix/profiles/per-user/ubuntu/
+ ln -s /var/guix/profiles/per-user/ubuntu/guix-profile-1-link /var/guix/profiles/per-user/ubuntu/guix-profile
+ /var/guix/profiles/per-user/ubuntu/guix-profile/bin/guix package -i guile
fi
+ln -s /var/guix/profiles/per-user/ubuntu/guix-profile ~/.guix-profile
EOF
,
# This is needed for things like guix copy to work