-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitea.nix
74 lines (68 loc) · 1.59 KB
/
gitea.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{ config, lib, pkgs, user, ... }:
let
stateDir = "/var/lib/gitea";
dumpFolder = "/engi/backup/dumps/gitea";
domain = "git.tstarr.us";
in {
# Main gitea service
systemd.tmpfiles.rules = [
"d ${dumpFolder} 0775 gitea gitea -"
];
environment.systemPackages = [
(pkgs.writeScriptBin "dump-gitea" ''
#!/bin/sh
cd ${dumpFolder}
[ -e gitea-dump.zip ] && rm gitea-dump.zip
exec ${pkgs.gitea}/bin/gitea dump --type zip -c ${stateDir}/custom/conf/app.ini --file "gitea-dump.zip"
'')
];
services.gitea = {
enable = true;
lfs.enable = true;
stateDir = "${stateDir}";
customDir = "${stateDir}/custom";
settings.server = {
DOMAIN = "${domain}";
HTTP_PORT = 3001;
ROOT_URL = "https://${domain}";
};
settings.service = {
DISABLE_REGISTRATION = true;
};
};
# Gitea runners
users.users.gitea-runner = {
createHome = false;
isSystemUser = true;
group = "gitea-runner";
};
users.groups.gitea-runner = {};
age.secrets."git/gitea-runner-1" = {
file = ../../secrets/git/gitea-runner-1.age;
owner = "gitea-runner";
group = "gitea-runner";
};
services.gitea-actions-runner.instances = {
runner1 = {
enable = true;
url = "https://${domain}";
tokenFile = "/run/agenix/git/gitea-runner-1";
name = "runner1";
labels = [
"native:host"
];
hostPackages = with pkgs; [
bash
coreutils
curl
gawk
gitMinimal
gnused
nodejs-18_x
wget
gnutar
gzip
];
};
};
}