Merge pull request #45608 from etu/fix-gitea-locale-updates

nixos/gitea: Symlink gitea locales to match running gitea version
This commit is contained in:
adisbladis 2018-08-25 15:25:27 +08:00 committed by GitHub
commit dff43f10f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,7 +261,8 @@ in
runConfig = "${cfg.stateDir}/custom/conf/app.ini"; runConfig = "${cfg.stateDir}/custom/conf/app.ini";
secretKey = "${cfg.stateDir}/custom/conf/secret_key"; secretKey = "${cfg.stateDir}/custom/conf/secret_key";
in '' in ''
mkdir -p ${cfg.stateDir} # Make sure that the stateDir exists, as well as the conf dir in there
mkdir -p ${cfg.stateDir}/conf
# copy custom configuration and generate a random secret key if needed # copy custom configuration and generate a random secret key if needed
${optionalString (cfg.useWizard == false) '' ${optionalString (cfg.useWizard == false) ''
@ -290,11 +291,13 @@ in
sed -ri 's,/nix/store/[a-z0-9.-]+/bin/bash,${pkgs.bash}/bin/bash,g' $HOOKS sed -ri 's,/nix/store/[a-z0-9.-]+/bin/bash,${pkgs.bash}/bin/bash,g' $HOOKS
sed -ri 's,/nix/store/[a-z0-9.-]+/bin/perl,${pkgs.perl}/bin/perl,g' $HOOKS sed -ri 's,/nix/store/[a-z0-9.-]+/bin/perl,${pkgs.perl}/bin/perl,g' $HOOKS
fi fi
if [ ! -d ${cfg.stateDir}/conf/locale ] # If we have a folder or symlink with gitea locales, remove it
if [ -e ${cfg.stateDir}/conf/locale ]
then then
mkdir -p ${cfg.stateDir}/conf rm -r ${cfg.stateDir}/conf/locale
cp -r ${gitea.out}/locale ${cfg.stateDir}/conf/locale
fi fi
# And symlink the current gitea locales in place
ln -s ${gitea.out}/locale ${cfg.stateDir}/conf/locale
# update command option in authorized_keys # update command option in authorized_keys
if [ -r ${cfg.stateDir}/.ssh/authorized_keys ] if [ -r ${cfg.stateDir}/.ssh/authorized_keys ]
then then