Loading nixos/modules/services/misc/gitea.nix +15 −15 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ with lib; let cfg = config.services.gitea; opt = options.services.gitea; gitea = cfg.package; exe = lib.getExe cfg.package; pg = config.services.postgresql; useMysql = cfg.database.type == "mysql"; usePostgresql = cfg.database.type == "postgres"; Loading Loading @@ -248,7 +248,7 @@ in staticRootPath = mkOption { type = types.either types.str types.path; default = gitea.data; default = cfg.package.data; defaultText = literalExpression "package.data"; example = "/var/lib/gitea/data"; description = lib.mdDoc "Upper level of template and static files path."; Loading Loading @@ -481,14 +481,14 @@ in # If we have a folder or symlink with gitea locales, remove it # And symlink the current gitea locales in place "L+ '${cfg.stateDir}/conf/locale' - - - - ${gitea.out}/locale" "L+ '${cfg.stateDir}/conf/locale' - - - - ${cfg.package.out}/locale" ]; systemd.services.gitea = { description = "gitea"; after = [ "network.target" ] ++ lib.optional usePostgresql "postgresql.service" ++ lib.optional useMysql "mysql.service"; wantedBy = [ "multi-user.target" ]; path = [ gitea pkgs.git pkgs.gnupg ]; path = [ cfg.package pkgs.git pkgs.gnupg ]; # In older versions the secret naming for JWT was kind of confusing. # The file jwt_secret hold the value for LFS_JWT_SECRET and JWT_SECRET Loading @@ -512,7 +512,7 @@ in cp -f ${configFile} ${runConfig} if [ ! -s ${secretKey} ]; then ${gitea}/bin/gitea generate secret SECRET_KEY > ${secretKey} ${exe} generate secret SECRET_KEY > ${secretKey} fi # Migrate LFS_JWT_SECRET filename Loading @@ -521,15 +521,15 @@ in fi if [ ! -s ${oauth2JwtSecret} ]; then ${gitea}/bin/gitea generate secret JWT_SECRET > ${oauth2JwtSecret} ${exe} generate secret JWT_SECRET > ${oauth2JwtSecret} fi if [ ! -s ${lfsJwtSecret} ]; then ${gitea}/bin/gitea generate secret LFS_JWT_SECRET > ${lfsJwtSecret} ${exe} generate secret LFS_JWT_SECRET > ${lfsJwtSecret} fi if [ ! -s ${internalToken} ]; then ${gitea}/bin/gitea generate secret INTERNAL_TOKEN > ${internalToken} ${exe} generate secret INTERNAL_TOKEN > ${internalToken} fi chmod u+w '${runConfig}' Loading @@ -548,15 +548,15 @@ in ''} # run migrations/init the database ${gitea}/bin/gitea migrate ${exe} migrate # update all hooks' binary paths ${gitea}/bin/gitea admin regenerate hooks ${exe} admin regenerate hooks # update command option in authorized_keys if [ -r ${cfg.stateDir}/.ssh/authorized_keys ] then ${gitea}/bin/gitea admin regenerate keys ${exe} admin regenerate keys fi ''; Loading @@ -565,7 +565,7 @@ in User = cfg.user; Group = "gitea"; WorkingDirectory = cfg.stateDir; ExecStart = "${gitea}/bin/gitea web --pid /run/gitea/gitea.pid"; ExecStart = "${exe} web --pid /run/gitea/gitea.pid"; Restart = "always"; # Runtime directory and mode RuntimeDirectory = "gitea"; Loading Loading @@ -635,7 +635,7 @@ in systemd.services.gitea-dump = mkIf cfg.dump.enable { description = "gitea dump"; after = [ "gitea.service" ]; path = [ gitea ]; path = [ cfg.package ]; environment = { USER = cfg.user; Loading @@ -646,7 +646,7 @@ in serviceConfig = { Type = "oneshot"; User = cfg.user; ExecStart = "${gitea}/bin/gitea dump --type ${cfg.dump.type}" + optionalString (cfg.dump.file != null) " --file ${cfg.dump.file}"; ExecStart = "${exe} dump --type ${cfg.dump.type}" + optionalString (cfg.dump.file != null) " --file ${cfg.dump.file}"; WorkingDirectory = cfg.dump.backupDir; }; }; Loading @@ -658,5 +658,5 @@ in timerConfig.OnCalendar = cfg.dump.interval; }; }; meta.maintainers = with lib.maintainers; [ srhb ma27 ]; meta.maintainers = with lib.maintainers; [ srhb ma27 thehedgeh0g ]; } Loading
nixos/modules/services/misc/gitea.nix +15 −15 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ with lib; let cfg = config.services.gitea; opt = options.services.gitea; gitea = cfg.package; exe = lib.getExe cfg.package; pg = config.services.postgresql; useMysql = cfg.database.type == "mysql"; usePostgresql = cfg.database.type == "postgres"; Loading Loading @@ -248,7 +248,7 @@ in staticRootPath = mkOption { type = types.either types.str types.path; default = gitea.data; default = cfg.package.data; defaultText = literalExpression "package.data"; example = "/var/lib/gitea/data"; description = lib.mdDoc "Upper level of template and static files path."; Loading Loading @@ -481,14 +481,14 @@ in # If we have a folder or symlink with gitea locales, remove it # And symlink the current gitea locales in place "L+ '${cfg.stateDir}/conf/locale' - - - - ${gitea.out}/locale" "L+ '${cfg.stateDir}/conf/locale' - - - - ${cfg.package.out}/locale" ]; systemd.services.gitea = { description = "gitea"; after = [ "network.target" ] ++ lib.optional usePostgresql "postgresql.service" ++ lib.optional useMysql "mysql.service"; wantedBy = [ "multi-user.target" ]; path = [ gitea pkgs.git pkgs.gnupg ]; path = [ cfg.package pkgs.git pkgs.gnupg ]; # In older versions the secret naming for JWT was kind of confusing. # The file jwt_secret hold the value for LFS_JWT_SECRET and JWT_SECRET Loading @@ -512,7 +512,7 @@ in cp -f ${configFile} ${runConfig} if [ ! -s ${secretKey} ]; then ${gitea}/bin/gitea generate secret SECRET_KEY > ${secretKey} ${exe} generate secret SECRET_KEY > ${secretKey} fi # Migrate LFS_JWT_SECRET filename Loading @@ -521,15 +521,15 @@ in fi if [ ! -s ${oauth2JwtSecret} ]; then ${gitea}/bin/gitea generate secret JWT_SECRET > ${oauth2JwtSecret} ${exe} generate secret JWT_SECRET > ${oauth2JwtSecret} fi if [ ! -s ${lfsJwtSecret} ]; then ${gitea}/bin/gitea generate secret LFS_JWT_SECRET > ${lfsJwtSecret} ${exe} generate secret LFS_JWT_SECRET > ${lfsJwtSecret} fi if [ ! -s ${internalToken} ]; then ${gitea}/bin/gitea generate secret INTERNAL_TOKEN > ${internalToken} ${exe} generate secret INTERNAL_TOKEN > ${internalToken} fi chmod u+w '${runConfig}' Loading @@ -548,15 +548,15 @@ in ''} # run migrations/init the database ${gitea}/bin/gitea migrate ${exe} migrate # update all hooks' binary paths ${gitea}/bin/gitea admin regenerate hooks ${exe} admin regenerate hooks # update command option in authorized_keys if [ -r ${cfg.stateDir}/.ssh/authorized_keys ] then ${gitea}/bin/gitea admin regenerate keys ${exe} admin regenerate keys fi ''; Loading @@ -565,7 +565,7 @@ in User = cfg.user; Group = "gitea"; WorkingDirectory = cfg.stateDir; ExecStart = "${gitea}/bin/gitea web --pid /run/gitea/gitea.pid"; ExecStart = "${exe} web --pid /run/gitea/gitea.pid"; Restart = "always"; # Runtime directory and mode RuntimeDirectory = "gitea"; Loading Loading @@ -635,7 +635,7 @@ in systemd.services.gitea-dump = mkIf cfg.dump.enable { description = "gitea dump"; after = [ "gitea.service" ]; path = [ gitea ]; path = [ cfg.package ]; environment = { USER = cfg.user; Loading @@ -646,7 +646,7 @@ in serviceConfig = { Type = "oneshot"; User = cfg.user; ExecStart = "${gitea}/bin/gitea dump --type ${cfg.dump.type}" + optionalString (cfg.dump.file != null) " --file ${cfg.dump.file}"; ExecStart = "${exe} dump --type ${cfg.dump.type}" + optionalString (cfg.dump.file != null) " --file ${cfg.dump.file}"; WorkingDirectory = cfg.dump.backupDir; }; }; Loading @@ -658,5 +658,5 @@ in timerConfig.OnCalendar = cfg.dump.interval; }; }; meta.maintainers = with lib.maintainers; [ srhb ma27 ]; meta.maintainers = with lib.maintainers; [ srhb ma27 thehedgeh0g ]; }