blob: 8955830cf06646cc1e304fbf67800bcc33080d2f (
plain)
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
|
{
config,
lib,
pkgs,
nixpkgs,
...
}: let
theme = pkgs.fetchzip {
url = "https://github.com/catppuccin/gitea/releases/download/v0.2.1/catppuccin-gitea.tar.gz";
sha256 = "sha256-HqVLW58lKPn81p3gTSjzkACHSBbmqPqeobAlJMubb8Y=";
stripRoot = false;
};
in {
users.users.forgejo = {
useDefaultShell = true;
home = "/var/lib/gitea";
group = "gitea";
isSystemUser = true;
};
services.gitea = let
domain = "git.${config.networking.domain}";
in {
enable = true;
package = (import nixpkgs {inherit (pkgs) system;}).forgejo;
inherit domain;
rootUrl = "https://${domain}/";
appName = "forgejo: with daddy issues";
httpAddress = "127.0.0.1";
user = "forgejo";
database.user = "forgejo";
settings = {
indexer.REPO_INDEXER_ENABLED = true;
session = {
COOKIE_SECURE = true;
PROVIDER = "db";
SAME_SITE = "strict";
};
service.DISABLE_REGISTRATION = true;
server = {
BUILTIN_SSH_USER = "forgejo";
ENABLE_GZIP = true;
SSH_AUTHORIZED_KEYS_BACKUP = false;
SSH_DOMAIN = domain;
};
ui = {
THEMES =
builtins.concatStringsSep
","
(["auto"]
++ (map (name: lib.removePrefix "theme-" (lib.removeSuffix ".css" name))
(builtins.attrNames (builtins.readDir theme))));
DEFAULT_THEME = "catppuccin-mocha-pink";
};
};
};
systemd.services.gitea = {
preStart = lib.mkAfter ''
rm -rf ${config.services.gitea.stateDir}/custom/public
mkdir -p ${config.services.gitea.stateDir}/custom/public
ln -sf ${theme} ${config.services.gitea.stateDir}/custom/public/css
'';
};
}
|