diff options
author | Tobias Happ <tobias.happ@gmx.de> | 2018-05-29 19:53:12 +0200 |
---|---|---|
committer | Tobias Happ <tobias.happ@gmx.de> | 2018-05-29 19:53:12 +0200 |
commit | 28c20a4731da9d5ba539e2d1ef6bcf3ddf1026ac (patch) | |
tree | 1866720a3e704f1d5619487652a5639e9838c917 /nixos/modules/services/misc/gitea.nix | |
parent | 51af2c330b2222f51383ecf11e89b8ec7571455e (diff) | |
download | nixlib-28c20a4731da9d5ba539e2d1ef6bcf3ddf1026ac.tar nixlib-28c20a4731da9d5ba539e2d1ef6bcf3ddf1026ac.tar.gz nixlib-28c20a4731da9d5ba539e2d1ef6bcf3ddf1026ac.tar.bz2 nixlib-28c20a4731da9d5ba539e2d1ef6bcf3ddf1026ac.tar.lz nixlib-28c20a4731da9d5ba539e2d1ef6bcf3ddf1026ac.tar.xz nixlib-28c20a4731da9d5ba539e2d1ef6bcf3ddf1026ac.tar.zst nixlib-28c20a4731da9d5ba539e2d1ef6bcf3ddf1026ac.zip |
nixos/gitea: fix pre start script
The hooks directory contains now one level deep subdirectories which need to be updated as well. If you use gitea via ssh, ~/.ssh/authorized_keys also needs to be updated because of the hardcoded path to gitea in the "command" option.
Diffstat (limited to 'nixos/modules/services/misc/gitea.nix')
-rw-r--r-- | nixos/modules/services/misc/gitea.nix | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix index 2d0f66de037d..45dfdc71eb36 100644 --- a/nixos/modules/services/misc/gitea.nix +++ b/nixos/modules/services/misc/gitea.nix @@ -282,7 +282,7 @@ in mkdir -p ${cfg.repositoryRoot} # update all hooks' binary paths - HOOKS=$(find ${cfg.repositoryRoot} -mindepth 4 -maxdepth 4 -type f -wholename "*git/hooks/*") + HOOKS=$(find ${cfg.repositoryRoot} -mindepth 4 -maxdepth 5 -type f -wholename "*git/hooks/*") if [ "$HOOKS" ] then sed -ri 's,/nix/store/[a-z0-9.-]+/bin/gitea,${gitea.bin}/bin/gitea,g' $HOOKS @@ -295,6 +295,11 @@ in mkdir -p ${cfg.stateDir}/conf cp -r ${gitea.out}/locale ${cfg.stateDir}/conf/locale fi + # update command option in authorized_keys + if [ -r ${cfg.stateDir}/.ssh/authorized_keys ] + then + sed -ri 's,/nix/store/[a-z0-9.-]+/bin/gitea,${gitea.bin}/bin/gitea,g' ${cfg.stateDir}/.ssh/authorized_keys + fi '' + optionalString (usePostgresql && cfg.database.createDatabase) '' if ! test -e "${cfg.stateDir}/db-created"; then echo "CREATE ROLE ${cfg.database.user} |