Compare commits

..

No commits in common. "470cc451e0097bb9d57fd9627e49763cf0393b28" and "736dc44008a5c526a52897f6f32147d23881f192" have entirely different histories.

View File

@ -1,4 +1,4 @@
{ config, values, lib, pkgs, unstablePkgs, ... }:
{ config, values, lib, unstablePkgs, ... }:
let
cfg = config.services.gitea;
domain = "git.pvv.ntnu.no";
@ -159,17 +159,8 @@ in {
environment.systemPackages = [ cfg.package ];
systemd.services.gitea.serviceConfig.Type = lib.mkForce "notify";
systemd.services.gitea.serviceConfig.WatchdogSec = "60";
systemd.services.gitea.serviceConfig.CPUSchedulingPolicy = "batch";
systemd.services.gitea.serviceConfig.CacheDirectory = "gitea/repo-archive";
systemd.services.gitea.serviceConfig.BindPaths = [
"%C/gitea/repo-archive:${cfg.stateDir}/data/repo-archive"
];
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
enableACME = true;
@ -193,14 +184,4 @@ in {
};
networking.firewall.allowedTCPPorts = [ sshPort ];
# Only keep n backup files at a time
systemd.services.gitea-dump.postStop = let
cu = prog: "'${lib.getExe' pkgs.coreutils prog}'";
backupCount = 3;
in ''
for file in $(${cu "ls"} -t1 '${cfg.dump.backupDir}' | ${cu "sort"} --reverse | ${cu "tail"} -n+${toString (backupCount + 1)}); do
${cu "rm"} "$file"
done
'';
}