From 22289be1a2b36d83c45ed52ac03c097b246e74ee Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 14 Aug 2020 08:49:44 -0300 Subject: Stop hardcoding the user in favor of $USER_NAME --- secrets/secret-envrc.sh | Bin 3237 -> 3242 bytes vps-configuration.env.nix | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/secrets/secret-envrc.sh b/secrets/secret-envrc.sh index f0eed7e..0076fab 100644 Binary files a/secrets/secret-envrc.sh and b/secrets/secret-envrc.sh differ diff --git a/vps-configuration.env.nix b/vps-configuration.env.nix index 1c954c2..a7f19c7 100644 --- a/vps-configuration.env.nix +++ b/vps-configuration.env.nix @@ -9,6 +9,7 @@ let letsencryptEmail = "$LETSENCRYPT_EMAIL"; authorizedKey = "$AUTHORIZED_KEY"; userPassword = "$USER_PASSWORD"; + userName = "$USER_NAME"; nextcloudDatabaseUser = "$NEXTCLOUD_DATABASE_USER"; nextcloudDatabasePassword = "$NEXTCLOUD_DATABASE_PASSWORD"; nextcloudAdminUser = "$NEXTCLOUD_ADMIN_USER"; @@ -177,7 +178,7 @@ in { wantedBy = [ "multi-user.target" ]; script = '' mkdir -p ${envsubstConfiguration.gitRoot} - chown -R andreh:lighttpd ${envsubstConfiguration.gitRoot} + chown -R ${envsubstConfiguration.userName}:lighttpd ${envsubstConfiguration.gitRoot} chmod -R 770 ${envsubstConfiguration.gitRoot} ''; serviceConfig = { @@ -186,7 +187,7 @@ in { }; }; - users.extraUsers.andreh = { + users.extraUsers."${envsubstConfiguration.userName}" = { uid = 1000; isNormalUser = true; extraGroups = [ "wheel" ]; -- cgit v1.2.3