Dynamic Environment Variables / Secret Management (with sops) #94
-
Hi! I'll start with stating my problem: I am trying to configure environmentFile = pkgs.writeText "test-file.txt" ''
rconpwd=$(cat ${config.sops.secrets."minecraft-servers/vanilla-1/rcon-password".path})
''; But I found out that this sets the respective systemd-setting, which does not interpolate the value and just returns Am I missing another option or maybe another solution here that could work better, or do I need to manually override some settings here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
What you would want to do would be to create a single file with all of the Minecraft server secrets, where the file contained
Then This isn't particularly well documented, and definitely could stand to be improved. In particular, the module does not have an option to have different environment files per-server. |
Beta Was this translation helpful? Give feedback.
What you would want to do would be to create a single file with all of the Minecraft server secrets, where the file contained
Then
environmentFile = config.sops.secrets."secrets-file".path;
To actually make use of this, you would use
serverProperties."rcon.password" = "@rconpwd@";
This isn't particularly well documented, and definitely could stand to be improved. In particular, the module does not have an option to have different environment files per-server.