nixos/services: swap gitea with forgejo
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
@import "/assets/css/theme-forgejo-dark.css";
|
||||||
|
|
||||||
|
/* :root { */
|
||||||
|
/* --is-dark-theme: true; */
|
||||||
|
|
||||||
|
/* --accent-color: 221, 85, 85; */
|
||||||
|
/* /1* #d55 *1/ */
|
||||||
|
/* --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)); */
|
||||||
|
/* } */
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--is-dark-theme: true;
|
||||||
|
|
||||||
|
--color-primary: #d162a4;
|
||||||
|
--color-primary-contrast: #fff;
|
||||||
|
--color-primary-dark-1: #ba3283;
|
||||||
|
--color-primary-dark-2: #b55690;
|
||||||
|
--color-primary-dark-3: #ac2c79;
|
||||||
|
--color-primary-dark-4: #a30262;
|
||||||
|
--color-primary-dark-5: #8a0253;
|
||||||
|
--color-primary-dark-6: #710144;
|
||||||
|
--color-primary-dark-7: #570135;
|
||||||
|
--color-primary-light-1: #d776af;
|
||||||
|
--color-primary-light-2: #dd89bb;
|
||||||
|
--color-primary-light-3: #e29dc6;
|
||||||
|
--color-primary-light-4: #e8b1d2;
|
||||||
|
--color-primary-light-5: #eec5dd;
|
||||||
|
--color-primary-light-6: #f4d8e9;
|
||||||
|
--color-primary-light-7: #f9ecf4;
|
||||||
|
--color-primary-alpha-10: #d162a419;
|
||||||
|
--color-primary-alpha-20: #d162a433;
|
||||||
|
--color-primary-alpha-30: #d162a44b;
|
||||||
|
--color-primary-alpha-40: #d162a466;
|
||||||
|
--color-primary-alpha-50: #d162a480;
|
||||||
|
--color-primary-alpha-60: #d162a499;
|
||||||
|
--color-primary-alpha-70: #d162a4b3;
|
||||||
|
--color-primary-alpha-80: #d162a4cc;
|
||||||
|
--color-primary-alpha-90: #d162a4e1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-left > #navbar-logo.item,
|
||||||
|
.navbar-right > #navbar-logo.item,
|
||||||
|
.navbar-mobile-right > #navbar-logo.item {
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
@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;
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
./acme.nix
|
./acme.nix
|
||||||
./dns.nix
|
./dns.nix
|
||||||
./fail2ban.nix
|
./fail2ban.nix
|
||||||
./gitea.nix
|
./forgejo.nix
|
||||||
./host.nix
|
./host.nix
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
./snapper.nix
|
./snapper.nix
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ let
|
|||||||
acmeEnabled = config.acme.enable;
|
acmeEnabled = config.acme.enable;
|
||||||
|
|
||||||
themeName = "tuxcord";
|
themeName = "tuxcord";
|
||||||
giteaPublic = pkgs.linkFarm "gitea-public" [
|
forgejoPublic = pkgs.linkFarm "forgejo-public" [
|
||||||
{
|
{
|
||||||
name = "assets/css/theme-${themeName}.css";
|
name = "assets/css/theme-${themeName}.css";
|
||||||
path = ../../assets/gitea/theme.css;
|
path = ../../assets/forgejo/theme.css;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "assets/img";
|
name = "assets/img";
|
||||||
@@ -23,7 +23,7 @@ let
|
|||||||
path = ../../assets/branding/logo.svg;
|
path = ../../assets/branding/logo.svg;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
giteaTemplates = ../../assets/gitea/templates;
|
forgejoTemplates = ../../assets/forgejo/templates;
|
||||||
|
|
||||||
makeGiteaImages =
|
makeGiteaImages =
|
||||||
{
|
{
|
||||||
@@ -32,7 +32,7 @@ let
|
|||||||
rasterWidth,
|
rasterWidth,
|
||||||
}:
|
}:
|
||||||
pkgs.stdenv.mkDerivation rec {
|
pkgs.stdenv.mkDerivation rec {
|
||||||
name = "gitea-images";
|
name = "forgejo-images";
|
||||||
|
|
||||||
srcs = [
|
srcs = [
|
||||||
big
|
big
|
||||||
@@ -44,7 +44,7 @@ let
|
|||||||
inkscape
|
inkscape
|
||||||
];
|
];
|
||||||
|
|
||||||
# https://docs.gitea.com/administration/customizing-gitea#changing-the-logo
|
# https://forgejo.org/docs/next/contributor/customization/#changing-the-logo
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
|
|
||||||
@@ -57,15 +57,18 @@ let
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.gitea = {
|
services.forgejo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
appName = "TuxCord Gitea";
|
|
||||||
database.type = "mysql";
|
database.type = "mysql";
|
||||||
|
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
DEFAULT = {
|
||||||
|
APP_NAME = "TuxCord Code Forge";
|
||||||
|
};
|
||||||
|
|
||||||
server = {
|
server = {
|
||||||
DOMAIN = fqdn;
|
DOMAIN = fqdn;
|
||||||
ROOT_URL = "${if acmeEnabled then "https" else "http"}://${fqdn}/";
|
ROOT_URL = "${if acmeEnabled then "https" else "http"}://${fqdn}/";
|
||||||
@@ -89,29 +92,34 @@ in
|
|||||||
|
|
||||||
# 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;
|
||||||
|
|
||||||
|
actions = {
|
||||||
|
ENABLED = true;
|
||||||
|
# DEFAULT_ACTIONS_URL = "github";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.gitea-branding = {
|
systemd.services.forgejo-branding = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
wantedBy = [ "gitea.service" ];
|
wantedBy = [ "forgejo.service" ];
|
||||||
before = [ "gitea.service" ];
|
before = [ "forgejo.service" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = pkgs.writeShellScript "gitea-branding.oneshot" ''
|
ExecStart = pkgs.writeShellScript "forgejo-branding.oneshot" ''
|
||||||
${pkgs.rsync}/bin/rsync -rl --chown gitea:gitea --delete ${giteaPublic}/ ${config.services.gitea.customDir}/public
|
${pkgs.rsync}/bin/rsync -rl --chown forgejo:forgejo --delete ${forgejoPublic}/ ${config.services.forgejo.customDir}/public
|
||||||
${pkgs.rsync}/bin/rsync -rl --chown gitea:gitea --delete ${giteaTemplates}/ ${config.services.gitea.customDir}/templates
|
${pkgs.rsync}/bin/rsync -rl --chown forgejo:forgejo --delete ${forgejoTemplates}/ ${config.services.forgejo.customDir}/templates
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.persistence."/persist".directories = [
|
environment.persistence."/persist".directories = [
|
||||||
{
|
{
|
||||||
directory = config.services.gitea.stateDir;
|
directory = config.services.forgejo.stateDir;
|
||||||
group = "gitea";
|
group = "forgejo";
|
||||||
user = "gitea";
|
user = "forgejo";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
"git.${fqdn}" = mkVhost { } {
|
"git.${fqdn}" = mkVhost { } {
|
||||||
"/" = mkProxy config.services.gitea.settings.server.HTTP_PORT;
|
"/" = mkProxy config.services.forgejo.settings.server.HTTP_PORT;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user