summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2018-08-25 15:25:27 +0800
committerGitHub <noreply@github.com>2018-08-25 15:25:27 +0800
commitdff43f10f60eb87395707d03c973e1a2817624e6 (patch)
tree1c40d593c406cf1e4118be6f9c03b918679bb532 /nixos
parentd6f8e722d8ff062b6ee5696f8fca5f734794690e (diff)
parenta098cc98d9da60692cb41d5f3f417708de00a9e4 (diff)
downloadnixlib-dff43f10f60eb87395707d03c973e1a2817624e6.tar
nixlib-dff43f10f60eb87395707d03c973e1a2817624e6.tar.gz
nixlib-dff43f10f60eb87395707d03c973e1a2817624e6.tar.bz2
nixlib-dff43f10f60eb87395707d03c973e1a2817624e6.tar.lz
nixlib-dff43f10f60eb87395707d03c973e1a2817624e6.tar.xz
nixlib-dff43f10f60eb87395707d03c973e1a2817624e6.tar.zst
nixlib-dff43f10f60eb87395707d03c973e1a2817624e6.zip
Merge pull request #45608 from etu/fix-gitea-locale-updates
nixos/gitea: Symlink gitea locales to match running gitea version
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/gitea.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix
index 5d664728e0b5..dc63f1a6c052 100644
--- a/nixos/modules/services/misc/gitea.nix
+++ b/nixos/modules/services/misc/gitea.nix
@@ -261,7 +261,8 @@ in
         runConfig = "${cfg.stateDir}/custom/conf/app.ini";
         secretKey = "${cfg.stateDir}/custom/conf/secret_key";
       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
         ${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/perl,${pkgs.perl}/bin/perl,g' $HOOKS
         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
-          mkdir -p ${cfg.stateDir}/conf
-          cp -r ${gitea.out}/locale ${cfg.stateDir}/conf/locale
+          rm -r ${cfg.stateDir}/conf/locale
         fi
+        # And symlink the current gitea locales in place
+        ln -s ${gitea.out}/locale ${cfg.stateDir}/conf/locale
         # update command option in authorized_keys
         if [ -r ${cfg.stateDir}/.ssh/authorized_keys ]
         then