Skip to content

Commit 7f5941d

Browse files
committed
artemis/forgejo: apply custom theme
1 parent 29a8187 commit 7f5941d

2 files changed

Lines changed: 43 additions & 8 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/index.css?v={{AssetVersion}}">
2+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{ThemeName .SignedUser | PathEscape}}.css?v={{AssetVersion}}">
3+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/style.css?v={{AssetVersion}}" />
4+

hosts/artemis/applications/forgejo/default.nix

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{ config, pkgs, ... }:
1+
{
2+
config,
3+
pkgs,
4+
...
5+
}:
26
{
37
services.forgejo = {
48
enable = true;
@@ -13,15 +17,11 @@
1317
};
1418
lfs.enable = true;
1519
settings = {
16-
DEFAULT = {
17-
APP_NAME = "marie's catgit: git with more meow";
18-
};
1920
server = {
2021
PROTOCOL = "http";
2122
HTTP_PORT = 8085;
2223
DOMAIN = "git.marie.cologne";
2324
ROOT_URL = "https://git.marie.cologne";
24-
STATIC_URL_PREFIX = "/_/static";
2525
OFFLINE_MODE = false;
2626
};
2727
other = {
@@ -48,13 +48,14 @@
4848
REGISTER_EMAIL_CONFIRM = false;
4949
USERNAME = "nickname";
5050
};
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+
};
5155
};
5256
};
5357

5458
services.nginx.virtualHosts."git.marie.cologne" = {
55-
locations."/_/static/" = {
56-
alias = "${config.services.forgejo.package.data}/public/";
57-
};
5859
locations."/" = {
5960
proxyPass = "http://unix:${config.services.anubis.instances.forgejo.settings.BIND}";
6061
extraConfig = ''
@@ -83,4 +84,34 @@
8384
TARGET = "http://127.0.0.1:${toString config.services.forgejo.settings.server.HTTP_PORT}";
8485
};
8586
};
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+
];
86117
}

0 commit comments

Comments
 (0)