feat: Switch all .env files to use age
This commit is contained in:
@@ -46,7 +46,6 @@ let
|
|||||||
|
|
||||||
# Get secret paths from age configuration (if configured)
|
# Get secret paths from age configuration (if configured)
|
||||||
envFile = config.age.secrets.usda-vision-env.path or null;
|
envFile = config.age.secrets.usda-vision-env.path or null;
|
||||||
azureEnvFile = config.age.secrets.usda-vision-azure-env.path or null;
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -151,7 +150,7 @@ in
|
|||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
WorkingDirectory = "/var/lib/supabase";
|
WorkingDirectory = "/var/lib/supabase";
|
||||||
EnvironmentFile="/var/lib/usda-vision/.env";
|
EnvironmentFile = envFile;
|
||||||
ExecStart = "${pkgs.supabase-cli}/bin/supabase start";
|
ExecStart = "${pkgs.supabase-cli}/bin/supabase start";
|
||||||
ExecStop = "${pkgs.supabase-cli}/bin/supabase stop";
|
ExecStop = "${pkgs.supabase-cli}/bin/supabase stop";
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
@@ -192,12 +191,6 @@ in
|
|||||||
chmod 644 /var/lib/usda-vision/.env
|
chmod 644 /var/lib/usda-vision/.env
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${lib.optionalString (azureEnvFile != null) ''
|
|
||||||
echo "Copying Azure environment file from ragenix-managed secret..."
|
|
||||||
cp ${azureEnvFile} /var/lib/usda-vision/.env.azure
|
|
||||||
chmod 644 /var/lib/usda-vision/.env.azure
|
|
||||||
''}
|
|
||||||
|
|
||||||
# Fallback: use example file if no secrets provided
|
# Fallback: use example file if no secrets provided
|
||||||
${lib.optionalString (envFile == null) ''
|
${lib.optionalString (envFile == null) ''
|
||||||
if [ ! -s /var/lib/usda-vision/.env ]; then
|
if [ ! -s /var/lib/usda-vision/.env ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user