Compare commits

...

1 commit

Author SHA1 Message Date
302646e996 forgejo/module.nix: add codeberg theme 2025-04-10 18:51:31 +02:00

View file

@ -4,8 +4,10 @@
pkgs,
...
}: let
inherit (pkgs) fetchurl;
inherit (lib.modules) mkIf;
inherit (config.services.forgejo) customDir user group;
cfg = config.modules.system.services.forgejo;
port = 3000;
@ -126,17 +128,40 @@ in {
User-agent: *
Disallow: /
'';
base-brand = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/codeberg/base-brand.css";
hash = lib.fakeHash;
};
dark-variables = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/codeberg/dark-variables.css";
hash = lib.fakeHash;
};
theme-codeberg-dark = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/theme-codeberg-dark.css";
hash = lib.fakeHash;
};
in [
"d '${customDir}/public' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets/img' 0750 ${user} ${group} - -"
# Copeberg logo, thanks Raf <3
"L+ '${customDir}/public/assets/img/logo.svg' - - - - ${img}/logo.svg"
"L+ '${customDir}/public/assets/img/logo.png' - - - - ${img}/logo.png"
"L+ '${customDir}/public/assets/img/apple-touch-icon' - - - - ${img}/logo.png"
"L+ '${customDir}/public/assets/img/favicon.svg' - - - - ${img}/logo.svg"
"L+ '${customDir}/public/assets/img/favicon.png' - - - - ${img}/logo.png"
# Theming shenanigans
"d '${customDir}/web_src' 0750 ${user} ${group} - -"
"d '${customDir}/web_src/css' 0750 ${user} ${group} - -"
"d '${customDir}/web_src/css/themes' 0750 ${user} ${group} - -"
"d '${customDir}/web_src/css/themes/codeberg' 0750 ${user} ${group} - -"
"L+ '${customDir}/web_src/css/themes/theme-codeberg-dark.css' - - - - ${theme-codeberg-dark}"
"L+ '${customDir}/web_src/css/themes/codeberg/base-brand.css' - - - - ${base-brand}"
"L+ '${customDir}/web_src/css/themes/codeberg/dark-variables.css' - - - - ${dark-variables}"
# Fuck off scrapers
"L+ ${customDir}/public/robots.txt - - - - ${robots.outPath}"
];
};