gitea: move out of module
This commit is contained in:
parent
22e6c556a3
commit
6bcc543cb4
@ -9,6 +9,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./gitea.nix
|
||||||
../server.nix
|
../server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -147,7 +148,6 @@
|
|||||||
realm = "turn.vimium.com";
|
realm = "turn.vimium.com";
|
||||||
matrixIntegration = true;
|
matrixIntegration = true;
|
||||||
};
|
};
|
||||||
gitea.enable = true;
|
|
||||||
headscale.enable = true;
|
headscale.enable = true;
|
||||||
matrix = {
|
matrix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
89
hosts/vps1/gitea.nix
Normal file
89
hosts/vps1/gitea.nix
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
domain = "git.vimium.com";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
users = {
|
||||||
|
users.git = {
|
||||||
|
isSystemUser = true;
|
||||||
|
useDefaultShell = true;
|
||||||
|
group = "git";
|
||||||
|
extraGroups = [ "gitea" ];
|
||||||
|
home = config.services.gitea.stateDir;
|
||||||
|
};
|
||||||
|
groups.git = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
upstreams.gitea = {
|
||||||
|
servers = {
|
||||||
|
"unix:${config.services.gitea.settings.server.HTTP_ADDR}" = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
virtualHosts = {
|
||||||
|
"${domain}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/".proxyPass = "http://gitea";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d '${config.services.gitea.customDir}/public/assets/css' 0750 ${config.services.gitea.user} ${config.services.gitea.group} - -"
|
||||||
|
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github.css' - - - - ${self.inputs.gitea-github-theme}/theme-github.css"
|
||||||
|
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github-auto.css' - - - - ${self.inputs.gitea-github-theme}/theme-github-auto.css"
|
||||||
|
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github-dark.css' - - - - ${self.inputs.gitea-github-theme}/theme-github-dark.css"
|
||||||
|
];
|
||||||
|
|
||||||
|
services.gitea = rec {
|
||||||
|
package = pkgs.unstable.gitea;
|
||||||
|
enable = true;
|
||||||
|
user = "git";
|
||||||
|
appName = "Vimium Git";
|
||||||
|
stateDir = "/var/lib/gitea";
|
||||||
|
repositoryRoot = "${stateDir}/repositories";
|
||||||
|
database = {
|
||||||
|
type = "sqlite3";
|
||||||
|
inherit user;
|
||||||
|
path = "${stateDir}/gitea.db";
|
||||||
|
};
|
||||||
|
lfs = {
|
||||||
|
enable = true;
|
||||||
|
contentDir = "${stateDir}/lfs";
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
DOMAIN = config.networking.domain;
|
||||||
|
LANDING_PAGE = "explore";
|
||||||
|
OFFLINE_MODE = true;
|
||||||
|
PROTOCOL = "http+unix";
|
||||||
|
SSH_USER = "git";
|
||||||
|
SSH_DOMAIN = "${domain}";
|
||||||
|
SSH_PORT = lib.head config.services.openssh.ports;
|
||||||
|
ROOT_URL = "https://${domain}/";
|
||||||
|
};
|
||||||
|
service.DISABLE_REGISTRATION = true;
|
||||||
|
session.COOKIE_SECURE = true;
|
||||||
|
log = {
|
||||||
|
ROOT_PATH = "${stateDir}/log";
|
||||||
|
"logger.router.MODE" = "";
|
||||||
|
};
|
||||||
|
ui = {
|
||||||
|
THEMES = "gitea,arc-green,github,github-auto,github-dark";
|
||||||
|
DEFAULT_THEME = "github-dark";
|
||||||
|
};
|
||||||
|
actions.ENABLED = true;
|
||||||
|
indexer = {
|
||||||
|
REPO_INDEXER_ENABLED = true;
|
||||||
|
};
|
||||||
|
packages.CHUNKED_UPLOAD_PATH = lib.mkForce "${stateDir}/data/tmp/package-upload";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,100 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.gitea;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.services.gitea = {
|
|
||||||
enable = lib.mkEnableOption "gitea";
|
|
||||||
domain = lib.mkOption {
|
|
||||||
type = lib.types.string;
|
|
||||||
default = "git.vimium.com";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
users = {
|
|
||||||
users.git = {
|
|
||||||
isSystemUser = true;
|
|
||||||
useDefaultShell = true;
|
|
||||||
group = "git";
|
|
||||||
extraGroups = [ "gitea" ];
|
|
||||||
home = config.services.gitea.stateDir;
|
|
||||||
};
|
|
||||||
groups.git = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx = {
|
|
||||||
upstreams.gitea = {
|
|
||||||
servers = {
|
|
||||||
"unix:${config.services.gitea.settings.server.HTTP_ADDR}" = { };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
virtualHosts = {
|
|
||||||
"${cfg.domain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/".proxyPass = "http://gitea";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
|
||||||
"d '${config.services.gitea.customDir}/public/assets/css' 0750 ${config.services.gitea.user} ${config.services.gitea.group} - -"
|
|
||||||
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github.css' - - - - ${self.inputs.gitea-github-theme}/theme-github.css"
|
|
||||||
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github-auto.css' - - - - ${self.inputs.gitea-github-theme}/theme-github-auto.css"
|
|
||||||
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github-dark.css' - - - - ${self.inputs.gitea-github-theme}/theme-github-dark.css"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.gitea = rec {
|
|
||||||
package = pkgs.unstable.gitea;
|
|
||||||
enable = true;
|
|
||||||
user = "git";
|
|
||||||
appName = "Vimium Git";
|
|
||||||
stateDir = "/var/lib/gitea";
|
|
||||||
repositoryRoot = "${stateDir}/repositories";
|
|
||||||
database = {
|
|
||||||
type = "sqlite3";
|
|
||||||
inherit user;
|
|
||||||
path = "${stateDir}/gitea.db";
|
|
||||||
};
|
|
||||||
lfs = {
|
|
||||||
enable = true;
|
|
||||||
contentDir = "${stateDir}/lfs";
|
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
server = {
|
|
||||||
DOMAIN = config.networking.domain;
|
|
||||||
LANDING_PAGE = "explore";
|
|
||||||
OFFLINE_MODE = true;
|
|
||||||
PROTOCOL = "http+unix";
|
|
||||||
SSH_USER = "git";
|
|
||||||
SSH_DOMAIN = "${cfg.domain}";
|
|
||||||
SSH_PORT = lib.head config.services.openssh.ports;
|
|
||||||
ROOT_URL = "https://${cfg.domain}/";
|
|
||||||
};
|
|
||||||
service.DISABLE_REGISTRATION = true;
|
|
||||||
session.COOKIE_SECURE = true;
|
|
||||||
log = {
|
|
||||||
ROOT_PATH = "${stateDir}/log";
|
|
||||||
"logger.router.MODE" = "";
|
|
||||||
};
|
|
||||||
ui = {
|
|
||||||
THEMES = "gitea,arc-green,github,github-auto,github-dark";
|
|
||||||
DEFAULT_THEME = "github-dark";
|
|
||||||
};
|
|
||||||
actions.ENABLED = true;
|
|
||||||
indexer = {
|
|
||||||
REPO_INDEXER_ENABLED = true;
|
|
||||||
};
|
|
||||||
packages.CHUNKED_UPLOAD_PATH = lib.mkForce "${stateDir}/data/tmp/package-upload";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user