mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
feat: adds forgejo service
This commit is contained in:
parent
da2fcf3f05
commit
69d170c965
1 changed files with 55 additions and 0 deletions
55
modules/services/forgejo.nix
Normal file
55
modules/services/forgejo.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
cfg = config.services.forgejo;
|
||||
srv = cfg.settings.server;
|
||||
in
|
||||
{
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
# database.type = "postgres";
|
||||
# Enable support for Git Large File Storage
|
||||
lfs.enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "code.liv.town";
|
||||
# You need to specify this to remove the port from URLs in the web UI.
|
||||
ROOT_URL = "https://${srv.DOMAIN}/";
|
||||
HTTP_PORT = 3050;
|
||||
};
|
||||
# You can temporarily allow registration to create an admin user.
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
# Add support for actions, based on act: https://github.com/nektos/act
|
||||
actions = {
|
||||
ENABLED = true;
|
||||
DEFAULT_ACTIONS_URL = "github";
|
||||
};
|
||||
# Sending emails is completely optional
|
||||
# You can send a test email from the web UI at:
|
||||
# Profile Picture > Site Administration > Configuration > Mailer Configuration
|
||||
# mailer = {
|
||||
# ENABLED = true;
|
||||
# SMTP_ADDR = "mail.example.com";
|
||||
# FROM = "noreply@${srv.DOMAIN}";
|
||||
# USER = "noreply@${srv.DOMAIN}";
|
||||
# };
|
||||
};
|
||||
# mailerPasswordFile = config.age.secrets.forgejo-mailer-password.path;
|
||||
};
|
||||
services = {
|
||||
nginx.virtualHosts."code.liv.town" = {
|
||||
forceSSL = true;
|
||||
sslCertificate = "/var/lib/acme/liv.town/cert.pem";
|
||||
sslCertificateKey = "/var/lib/acme/liv.town/key.pem";
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:3050";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
# systemd.services.forgejo.preStart = let
|
||||
# adminCmd = "${lib.getExe cfg.package} admin user";
|
||||
# user = "liv";
|
||||
# in ''
|
||||
# ${adminCmd} create --admin --email "liv@liv.town" --username ${user} --password "boopbeepboop123123123" || true
|
||||
# '';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue