mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
gitea: add new service
This commit is contained in:
parent
5c88d557d5
commit
e28e66e5f5
1 changed files with 55 additions and 0 deletions
55
modules/services/gitea/default.nix
Normal file
55
modules/services/gitea/default.nix
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
# self-hosted git service
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.gitea;
|
||||||
|
domain = config.networking.domain;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.gitea = with lib; {
|
||||||
|
enable = mkEnableOption "Gitea";
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 3042;
|
||||||
|
example = 8080;
|
||||||
|
description = "Internal port";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.gitea = {
|
||||||
|
enable = true;
|
||||||
|
httpPort = cfg.port;
|
||||||
|
log.level = "Warn";
|
||||||
|
disableRegistration = true;
|
||||||
|
cookieSecure = true;
|
||||||
|
settings = {
|
||||||
|
ui.DEFAULT_THEME = "arc-green";
|
||||||
|
};
|
||||||
|
lfs.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Proxy to Gitea
|
||||||
|
my.services.nginx.virtualHosts = [
|
||||||
|
{
|
||||||
|
subdomain = "git";
|
||||||
|
inherit (cfg) port;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
#my.services.backup = {
|
||||||
|
# paths = [
|
||||||
|
# config.services.gitea.lfs.contentDir
|
||||||
|
# config.services.gitea.repositoryRoot
|
||||||
|
# ];
|
||||||
|
#};
|
||||||
|
|
||||||
|
webapps.apps.gitea = {
|
||||||
|
dashboard = {
|
||||||
|
name = "Git";
|
||||||
|
category = "app";
|
||||||
|
icon = "git";
|
||||||
|
link = "https://git.${domain}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue