mirror of
https://github.com/zhaofengli/attic.git
synced 2024-12-14 11:57:30 +00:00
parent
5a23cda073
commit
0bb3d00136
1 changed files with 14 additions and 1 deletions
|
@ -22,6 +22,17 @@ let
|
|||
cat <$configFile >$out
|
||||
'';
|
||||
|
||||
atticadmShim = pkgs.writeShellScript "atticadm" ''
|
||||
if [ -n "$ATTICADM_PWD" ]; then
|
||||
cd "$ATTICADM_PWD"
|
||||
if [ "$?" != "0" ]; then
|
||||
>&2 echo "Warning: Failed to change directory to $ATTICADM_PWD"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec ${cfg.package}/bin/atticadm -f ${checkedConfigFile} "$@"
|
||||
'';
|
||||
|
||||
atticadmWrapper = pkgs.writeShellScriptBin "atticd-atticadm" ''
|
||||
exec systemd-run \
|
||||
--pty \
|
||||
|
@ -32,8 +43,10 @@ let
|
|||
--property=EnvironmentFile=${cfg.credentialsFile} \
|
||||
--property=DynamicUser=yes \
|
||||
--property=User=atticd \
|
||||
--property=Environment=ATTICADM_PWD=$(pwd) \
|
||||
--working-directory / \
|
||||
-- \
|
||||
${cfg.package}/bin/atticadm -f ${checkedConfigFile} "$@"
|
||||
${atticadmShim} "$@"
|
||||
'';
|
||||
|
||||
hasLocalPostgresDB = let
|
||||
|
|
Loading…
Reference in a new issue