mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/devpi-server: fix loading credentials as DynamicUser
(cherry picked from commit 4d4571b20a
)
This commit is contained in:
parent
39ffb04fef
commit
cf546b0bf0
1 changed files with 6 additions and 2 deletions
|
@ -74,8 +74,9 @@ in
|
|||
# have 0600 permissions.
|
||||
preStart =
|
||||
''
|
||||
cp ${cfg.secretFile} ${runtimeDir}/${secretsFileName}
|
||||
chmod 0600 ${runtimeDir}/*${secretsFileName}
|
||||
${optionalString (!isNull cfg.secretFile)
|
||||
"install -Dm 0600 \${CREDENTIALS_DIRECTORY}/devpi-secret ${runtimeDir}/${secretsFileName}"
|
||||
}
|
||||
|
||||
if [ -f ${serverDir}/.nodeinfo ]; then
|
||||
# already initialized the package index, exit gracefully
|
||||
|
@ -85,6 +86,9 @@ in
|
|||
+ strings.optionalString cfg.replica "--role=replica --master-url=${cfg.primaryUrl}";
|
||||
|
||||
serviceConfig = {
|
||||
LoadCredential = lib.mkIf (! isNull cfg.secretFile) [
|
||||
"devpi-secret:${cfg.secretFile}"
|
||||
];
|
||||
Restart = "always";
|
||||
ExecStart =
|
||||
let
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue