Add gitea
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./git.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./nextcloud.nix
|
./nextcloud.nix
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.gitea = rec {
|
||||||
|
enable = true;
|
||||||
|
appName = "Greg's Sources";
|
||||||
|
cookieSecure = true;
|
||||||
|
database = {
|
||||||
|
type = "postgres";
|
||||||
|
user = "gitea";
|
||||||
|
};
|
||||||
|
disableRegistration = true;
|
||||||
|
domain = "src.thehellings.com";
|
||||||
|
dump = {
|
||||||
|
enable = true;
|
||||||
|
type = "tar.xz";
|
||||||
|
};
|
||||||
|
rootUrl = "https://${domain}/";
|
||||||
|
};
|
||||||
|
|
||||||
|
greg.proxies."src.thehellings.com" = {
|
||||||
|
target = "http://localhost:${toString config.services.gitea.httpPort}";
|
||||||
|
ssl = true;
|
||||||
|
genAliases = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
greg.backup.jobs.gitea = {
|
||||||
|
src = config.services.gitea.dump.backupDir;
|
||||||
|
dest = "gitea";
|
||||||
|
user = "gitea";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.logrotate = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
gitea = {
|
||||||
|
enable = true;
|
||||||
|
files = "${config.services.gitea.dump.backupDir}/*";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
checkConfig = true;
|
checkConfig = true;
|
||||||
ensureDatabases = [ "nextcloud" ];
|
ensureDatabases = [ "nextcloud" "gitea" ];
|
||||||
initialScript = pkgs.writeText "create-matrix-db.sql" ''
|
initialScript = pkgs.writeText "create-matrix-db.sql" ''
|
||||||
CREATE ROLE "matrix-synapse" WITH LOGIN;
|
CREATE ROLE "matrix-synapse" WITH LOGIN;
|
||||||
CREATE DATABASE "synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" LC_CTYPE = "C";
|
CREATE DATABASE "synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" LC_CTYPE = "C";
|
||||||
@@ -16,6 +16,9 @@
|
|||||||
} {
|
} {
|
||||||
name = "root";
|
name = "root";
|
||||||
ensurePermissions."ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
|
ensurePermissions."ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
|
||||||
|
} {
|
||||||
|
name = "gitea";
|
||||||
|
ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES";
|
||||||
} ];
|
} ];
|
||||||
settings = {
|
settings = {
|
||||||
log_connections = true;
|
log_connections = true;
|
||||||
@@ -30,6 +33,7 @@ root root postgres
|
|||||||
services.postgresqlBackup = {
|
services.postgresqlBackup = {
|
||||||
enable = true;
|
enable = true;
|
||||||
databases = [
|
databases = [
|
||||||
|
"gitea"
|
||||||
"nextcloud"
|
"nextcloud"
|
||||||
"synapse"
|
"synapse"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ in with lib; {
|
|||||||
key = mkOption {
|
key = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
description = "SSH key to use";
|
description = "SSH key to use";
|
||||||
default = ./ssh/id_ed25519;
|
default = ../ssh/id_ed25519;
|
||||||
};
|
};
|
||||||
|
|
||||||
jobs = mkOption {
|
jobs = mkOption {
|
||||||
|
|||||||
Reference in New Issue
Block a user