mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-09-18 00:06:47 +02:00
Compare commits
4 Commits
736dc44008
...
470cc451e0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
470cc451e0 | ||
![]() |
a803de2b23 | ||
![]() |
1dc78b6101 | ||
![]() |
54434b7f93 |
@ -1,4 +1,4 @@
|
||||
{ config, values, lib, unstablePkgs, ... }:
|
||||
{ config, values, lib, pkgs, unstablePkgs, ... }:
|
||||
let
|
||||
cfg = config.services.gitea;
|
||||
domain = "git.pvv.ntnu.no";
|
||||
@ -159,8 +159,17 @@ 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;
|
||||
@ -184,4 +193,14 @@ 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
|
||||
'';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user