[gitea] Deploy
This commit is contained in:
48
lib/modules/gitea/default.nix
Normal file
48
lib/modules/gitea/default.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{config, pkgs, ...}:
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.gitea;
|
||||
domain = "source.ctsk.dev";
|
||||
port = 10010;
|
||||
|
||||
in {
|
||||
services.gitea = {
|
||||
stateDir = "/srv/gitea";
|
||||
appName = "WITHOUT WARRANTY OF ANY KIND";
|
||||
database = {
|
||||
type = "sqlite3";
|
||||
};
|
||||
settings = {
|
||||
server = {
|
||||
ROOT_URL = "https://${domain}";
|
||||
HTTP_ADDRESS = "127.0.0.1";
|
||||
HTTP_PORT = port;
|
||||
SSH_USER = "git";
|
||||
SSH_PORT = 2324;
|
||||
LANDING_PAGE = "explore";
|
||||
};
|
||||
service = {
|
||||
DISABLE_REGISTRATION = true;
|
||||
DISABLE_USERS_PAGE = true;
|
||||
};
|
||||
repository = {
|
||||
ENABLE_PUSH_CREATE_USER = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."${domain}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/".proxyPass = "http://127.0.0.1:${toString port}";
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
''L+ ${cfg.stateDir}/custom/public/assets/img/logo.svg - - - - ${pkgs.logo.svg}''
|
||||
''L+ ${cfg.stateDir}/custom/public/assets/img/logo.png - - - - ${pkgs.logo.png."512x512"}''
|
||||
];
|
||||
|
||||
environment.systemPackages = [ pkgs.gitea ];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user