Add git server
This commit is contained in:
parent
faec7247c4
commit
31cf4df2c6
4 changed files with 98 additions and 0 deletions
|
@ -41,6 +41,12 @@
|
||||||
fast = true;
|
fast = true;
|
||||||
location = "192.168.0.1";
|
location = "192.168.0.1";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
path = "zdata/big-apps/git";
|
||||||
|
remotePath = "zdata/recv/lasting-integrity/big-apps/git";
|
||||||
|
fast = true;
|
||||||
|
location = "192.168.0.1";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
path = "zdata/big-apps/mail";
|
path = "zdata/big-apps/mail";
|
||||||
remotePath = "zdata/recv/lasting-integrity/big-apps/mail";
|
remotePath = "zdata/recv/lasting-integrity/big-apps/mail";
|
||||||
|
@ -69,6 +75,7 @@
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
garmin-scraper.enable = true;
|
garmin-scraper.enable = true;
|
||||||
|
git.enable = true;
|
||||||
grafana.enable = true;
|
grafana.enable = true;
|
||||||
mail.enable = true;
|
mail.enable = true;
|
||||||
mastodon.enable = true;
|
mastodon.enable = true;
|
||||||
|
|
|
@ -58,6 +58,10 @@
|
||||||
device = "zdata/big-apps/mastodon";
|
device = "zdata/big-apps/mastodon";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
};
|
};
|
||||||
|
"/var/lib/git" = {
|
||||||
|
device = "zdata/big-apps/git";
|
||||||
|
fsType = "zfs";
|
||||||
|
};
|
||||||
"/cache" = {
|
"/cache" = {
|
||||||
device = "zroot/safe/cache";
|
device = "zroot/safe/cache";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
./data-access
|
./data-access
|
||||||
./deluge
|
./deluge
|
||||||
./garmin-scraper
|
./garmin-scraper
|
||||||
|
./git
|
||||||
./grafana
|
./grafana
|
||||||
./mail
|
./mail
|
||||||
./mastodon
|
./mastodon
|
||||||
|
|
86
modules/services/git/default.nix
Normal file
86
modules/services/git/default.nix
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
options.chvp.services.git.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.chvp.services.git.enable {
|
||||||
|
chvp.services.nginx.hosts = [{
|
||||||
|
fqdn = "git.chvp.be";
|
||||||
|
options = {
|
||||||
|
root = pkgs.gitea.data;
|
||||||
|
locations = {
|
||||||
|
"/".tryFiles = "$uri @proxy";
|
||||||
|
"@proxy" = {
|
||||||
|
proxyPass = "http://unix:/run/gitea/gitea.sock";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
users = {
|
||||||
|
users = {
|
||||||
|
git = {
|
||||||
|
uid = 963;
|
||||||
|
home = "/var/lib/git";
|
||||||
|
group = "git";
|
||||||
|
isSystemUser = true;
|
||||||
|
useDefaultShell = true;
|
||||||
|
};
|
||||||
|
nginx.extraGroups = [ "git" ];
|
||||||
|
};
|
||||||
|
groups.git.gid = 963;
|
||||||
|
};
|
||||||
|
services.openssh.settings.AcceptEnv = "GIT_PROTOCOL";
|
||||||
|
services.gitea = {
|
||||||
|
enable = true;
|
||||||
|
stateDir = "/var/lib/git";
|
||||||
|
user = "git";
|
||||||
|
database = {
|
||||||
|
type = "postgres";
|
||||||
|
createDatabase = true;
|
||||||
|
user = "git";
|
||||||
|
name = "git";
|
||||||
|
};
|
||||||
|
dump.enable = true;
|
||||||
|
lfs.enable = true;
|
||||||
|
appName = "Charlotte's personal git server";
|
||||||
|
domain = "git.chvp.be";
|
||||||
|
rootUrl = "https://git.chvp.be/";
|
||||||
|
enableUnixSocket = true;
|
||||||
|
settings = {
|
||||||
|
repository = {
|
||||||
|
DEFAULT_PRIVATE = "private";
|
||||||
|
ENABLE_PUSH_CREATE_USER = true;
|
||||||
|
ENABLE_PUSH_CREATE_ORG = true;
|
||||||
|
};
|
||||||
|
"repository.pull-request".DEFAULT_MERGE_STYLE = "squash";
|
||||||
|
"repository.mimetype_mapping" = {
|
||||||
|
".apk" = "application/vnd.android.package-archive";
|
||||||
|
};
|
||||||
|
ui.DEFAULT_SHOW_FULL_NAME = true;
|
||||||
|
security.DISABLE_GIT_HOOKS = false;
|
||||||
|
service = {
|
||||||
|
ENABLE_NOTIFY_EMAIL = true;
|
||||||
|
EMAIL_DOMAIN_WHITELIST = "chvp.be";
|
||||||
|
REGISTER_EMAIL_CONFIRM = true;
|
||||||
|
AUTO_WATCH_ON_CHANGES = true;
|
||||||
|
};
|
||||||
|
mailer = {
|
||||||
|
ENABLED = true;
|
||||||
|
FROM = "git@chvp.be";
|
||||||
|
PROTOCOL = "smtp";
|
||||||
|
SMTP_ADDR = "localhost";
|
||||||
|
SMTP_PORT = 25;
|
||||||
|
};
|
||||||
|
session.COOKIE_SECURE = true;
|
||||||
|
cron = {
|
||||||
|
ENABLED = true;
|
||||||
|
SCHEDULE = "@every 1h";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue