nixos/services: lay ground for gitea branding
also makes adds gitea persistence
This commit is contained in:
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 13 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,12 @@
|
|||||||
|
{{template "base/head" .}}
|
||||||
|
<div role="main" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}"
|
||||||
|
class="page-content home tw-mb-8 tw-px-8 center" style="height: 100%; flex-direction: column; display: flex; align-items: center; justify-content: space-around;">
|
||||||
|
<img width="500" height="500" src="{{AssetUrlPrefix}}/images/full-logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
|
||||||
|
<div class="hero">
|
||||||
|
<h1 class="ui icon header title">
|
||||||
|
{{AppName}}
|
||||||
|
</h1>
|
||||||
|
<!-- <h2>My own gitea server 😎</h2> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{template "base/footer" .}}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
@import "/assets/css/theme-gitea-dark.css";
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--is-dark-theme: true;
|
||||||
|
|
||||||
|
--accent-color: 221, 85, 85; /* #d55 */
|
||||||
|
--gitea-color-primary-dark-4: 221, 85, 85;
|
||||||
|
--accent-color-secondary: 96, 72, 10;
|
||||||
|
--accent-color-hover: 170, 68, 68;
|
||||||
|
--color-primary: rgb(var(--accent-color));
|
||||||
|
--color-secondary: rgb(var(--accent-color-secondary));
|
||||||
|
--button-color: rgb(var(--accent-color));
|
||||||
|
--button-color-hover: rgb(var(--accent-color-hover));
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-left > #navbar-logo.item, .navbar-right > #navbar-logo.item, .navbar-mobile-right > #navbar-logo.item {
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
+79
-2
@@ -1,8 +1,60 @@
|
|||||||
{ config, ... }:
|
{ config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
inherit (config.networking) fqdn;
|
inherit (config.networking) fqdn;
|
||||||
|
|
||||||
acmeEnabled = config.acme.enable;
|
acmeEnabled = config.acme.enable;
|
||||||
|
|
||||||
|
themeName = "tuxcord";
|
||||||
|
giteaPublic = pkgs.linkFarm "gitea-public" [
|
||||||
|
{
|
||||||
|
name = "assets/css/theme-${themeName}.css";
|
||||||
|
path = ../../assets/gitea/theme.css;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "assets/img";
|
||||||
|
path = makeGiteaImages {
|
||||||
|
big = ../../assets/branding/logo.svg;
|
||||||
|
small = ../../assets/branding/logo-head.svg;
|
||||||
|
rasterWidth = 1024;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "assets/images/full-logo.svg";
|
||||||
|
path = ../../assets/branding/logo.svg;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
giteaTemplates = ../../assets/gitea/templates;
|
||||||
|
|
||||||
|
makeGiteaImages =
|
||||||
|
{
|
||||||
|
big,
|
||||||
|
small,
|
||||||
|
rasterWidth,
|
||||||
|
}:
|
||||||
|
pkgs.stdenv.mkDerivation rec {
|
||||||
|
name = "gitea-images";
|
||||||
|
|
||||||
|
srcs = [
|
||||||
|
big
|
||||||
|
small
|
||||||
|
];
|
||||||
|
unpackPhase = "true";
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
inkscape
|
||||||
|
];
|
||||||
|
|
||||||
|
# https://docs.gitea.com/administration/customizing-gitea#changing-the-logo
|
||||||
|
buildPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
|
||||||
|
cp "${big}" $out/logo.svg
|
||||||
|
inkscape -w ${toString rasterWidth} ${big} -o $out/logo.png
|
||||||
|
|
||||||
|
cp "${small}" $out/favicon.svg
|
||||||
|
inkscape -w ${toString rasterWidth} ${small} -o $out/favicon.png
|
||||||
|
'';
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
@@ -31,10 +83,35 @@ in
|
|||||||
DEFAULT_BRANCH = "main";
|
DEFAULT_BRANCH = "main";
|
||||||
};
|
};
|
||||||
|
|
||||||
# ui.DEFAULT_THEME = "...";
|
ui = {
|
||||||
|
DEFAULT_THEME = themeName;
|
||||||
|
};
|
||||||
|
|
||||||
# TODO: once we have email setup this would be nice
|
# TODO: once we have email setup this would be nice
|
||||||
mailer.ENABLED = true;
|
mailer.ENABLED = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.gitea-branding = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
wantedBy = [ "gitea.service" ];
|
||||||
|
before = [ "gitea.service" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = pkgs.writeShellScript "gitea-branding.oneshot" ''
|
||||||
|
${pkgs.rsync}/bin/rsync -rl --chown gitea:gitea --delete ${giteaPublic}/ ${config.services.gitea.customDir}/public
|
||||||
|
${pkgs.rsync}/bin/rsync -rl --chown gitea:gitea --delete ${giteaTemplates}/ ${config.services.gitea.customDir}/templates
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence."/persist".directories = [
|
||||||
|
{
|
||||||
|
directory = config.services.gitea.stateDir;
|
||||||
|
group = "gitea";
|
||||||
|
user = "gitea";
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user