forked from Drift/pvv-nixos-config
bekkalokk/gitea: use systemd unit for gitea customization
This commit is contained in:
parent
5bed292a01
commit
b7b1c73bfa
|
@ -50,8 +50,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.gitea-themes.monokai = pkgs.gitea-theme-monokai;
|
|
||||||
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
services.nginx.virtualHosts."${domain}" = {
|
services.nginx.virtualHosts."${domain}" = {
|
||||||
|
@ -68,12 +66,28 @@ in {
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ sshPort ];
|
networking.firewall.allowedTCPPorts = [ sshPort ];
|
||||||
|
|
||||||
system.activationScripts.linkGiteaLogo.text = let
|
# Extra customization
|
||||||
|
|
||||||
|
services.gitea-themes.monokai = pkgs.gitea-theme-monokai;
|
||||||
|
|
||||||
|
systemd.services.install-gitea-customization = {
|
||||||
|
description = "Install extra customization in gitea's CUSTOM_DIR";
|
||||||
|
wantedBy = [ "gitea.service" ];
|
||||||
|
requiredBy = [ "gitea.service" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = cfg.user;
|
||||||
|
Group = cfg.group;
|
||||||
|
};
|
||||||
|
|
||||||
|
script = let
|
||||||
logo-svg = ../../../../assets/logo_blue_regular.svg;
|
logo-svg = ../../../../assets/logo_blue_regular.svg;
|
||||||
logo-png = ../../../../assets/logo_blue_regular.png;
|
logo-png = ../../../../assets/logo_blue_regular.png;
|
||||||
in ''
|
in ''
|
||||||
install -Dm444 ${logo-svg} ${cfg.stateDir}/custom/public/img/logo.svg
|
install -Dm444 ${logo-svg} ${cfg.customDir}/public/img/logo.svg
|
||||||
install -Dm444 ${logo-png} ${cfg.stateDir}/custom/public/img/logo.png
|
install -Dm444 ${logo-png} ${cfg.customDir}/public/img/logo.png
|
||||||
install -Dm444 ${./loading.apng} ${cfg.stateDir}/custom/public/img/loading.png
|
install -Dm444 ${./loading.apng} ${cfg.customDir}/public/img/loading.png
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue