|
1 | | -{ config, pkgs, ... }: |
| 1 | +{ |
| 2 | + config, |
| 3 | + pkgs, |
| 4 | + ... |
| 5 | +}: |
2 | 6 | { |
3 | 7 | services.forgejo = { |
4 | 8 | enable = true; |
|
13 | 17 | }; |
14 | 18 | lfs.enable = true; |
15 | 19 | settings = { |
16 | | - DEFAULT = { |
17 | | - APP_NAME = "marie's catgit: git with more meow"; |
18 | | - }; |
19 | 20 | server = { |
20 | 21 | PROTOCOL = "http"; |
21 | 22 | HTTP_PORT = 8085; |
22 | 23 | DOMAIN = "git.marie.cologne"; |
23 | 24 | ROOT_URL = "https://git.marie.cologne"; |
24 | | - STATIC_URL_PREFIX = "/_/static"; |
25 | 25 | OFFLINE_MODE = false; |
26 | 26 | }; |
27 | 27 | other = { |
|
48 | 48 | REGISTER_EMAIL_CONFIRM = false; |
49 | 49 | USERNAME = "nickname"; |
50 | 50 | }; |
| 51 | + ui = { |
| 52 | + DEFAULT_THEME = "gitdotgay"; |
| 53 | + THEMES = "gitdotgay, gitdotgay-light, gitdotgay-dark, forgejo-auto, forgejo-light, forgejo-dark, gitea-auto, gitea-light, gitea-dark, forgejo-auto-deuteranopia-protanopia, forgejo-light-deuteranopia-protanopia, forgejo-dark-deuteranopia-protanopia, forgejo-auto-tritanopia, forgejo-light-tritanopia, forgejo-dark-tritanopia"; |
| 54 | + }; |
51 | 55 | }; |
52 | 56 | }; |
53 | 57 |
|
54 | 58 | services.nginx.virtualHosts."git.marie.cologne" = { |
55 | | - locations."/_/static/" = { |
56 | | - alias = "${config.services.forgejo.package.data}/public/"; |
57 | | - }; |
58 | 59 | locations."/" = { |
59 | 60 | proxyPass = "http://unix:${config.services.anubis.instances.forgejo.settings.BIND}"; |
60 | 61 | extraConfig = '' |
|
83 | 84 | TARGET = "http://127.0.0.1:${toString config.services.forgejo.settings.server.HTTP_PORT}"; |
84 | 85 | }; |
85 | 86 | }; |
| 87 | + |
| 88 | + systemd.tmpfiles.rules = |
| 89 | + let |
| 90 | + cfg = config.services.forgejo; |
| 91 | + gitgaySrc = pkgs.fetchFromGitea { |
| 92 | + domain = "git.gay"; |
| 93 | + owner = "marie"; |
| 94 | + repo = "forgejo"; |
| 95 | + rev = "87d13f36e7da4d3d99cacecde14f380bb88294e2"; |
| 96 | + hash = "sha256-ynbPMvDhMIBh9K0/jISSriNxnsjHIX9Us6HBe1el8aw="; |
| 97 | + }; |
| 98 | + gitgayAssets = pkgs.fetchFromGitea { |
| 99 | + domain = "git.gay"; |
| 100 | + owner = "gitgay"; |
| 101 | + repo = "assets"; |
| 102 | + rev = "35ddd92af9da884f112b5a3224b8685ac92b627f"; |
| 103 | + hash = "sha256-KiDLQrsx7d9InuVvsdgKhPIlAAZk4jr4aMm3WkH+YiE="; |
| 104 | + }; |
| 105 | + customContent = pkgs.runCommand "forgejo-custom-content" { } '' |
| 106 | + mkdir -p $out/{public/assets/css,templates/base} |
| 107 | + cp ${gitgaySrc}/web_src/css/themes/theme-gitdotgay{,-light,-dark}.css $out/public/assets/css |
| 108 | + cp ${./custom-content/head_style.tmpl} $out/templates/base/head_style.tmpl |
| 109 | + cp ${gitgayAssets}/public/assets/font/DMSans/* $out/public/assets/css |
| 110 | + ''; |
| 111 | + in |
| 112 | + [ |
| 113 | + "d '${cfg.customDir}/public' 0750 ${cfg.user} ${cfg.group} - -" |
| 114 | + "L+ '${cfg.customDir}/public/assets' - - - - ${customContent}/public/assets" |
| 115 | + "L+ '${cfg.customDir}/templates' - - - - ${customContent}/templates" |
| 116 | + ]; |
86 | 117 | } |
0 commit comments