Skip to content

Instantly share code, notes, and snippets.

@Riesi
Last active March 29, 2026 12:28
Show Gist options
  • Select an option

  • Save Riesi/75bde26aad6ca36b6a6da8c52a359da1 to your computer and use it in GitHub Desktop.

Select an option

Save Riesi/75bde26aad6ca36b6a6da8c52a359da1 to your computer and use it in GitHub Desktop.
{ 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 = "forgejo.home";
# You need to specify this to remove the port from URLs in the web UI.
ROOT_URL = "https://${srv.DOMAIN}/";
HTTP_PORT = 8080;
SSH_PORT = lib.head config.services.openssh.ports;
};
# 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 = false;
SMTP_ADDR = "mail.example.com";
FROM = "noreply@${srv.DOMAIN}";
USER = "noreply@${srv.DOMAIN}";
};
};
#secrets = {
# mailer.PASSWD = config.age.secrets.forgejo-mailer-password.path;
#};
};
#age.secrets.forgejo-mailer-password = {
# file = ../secrets/forgejo-mailer-password.age;
# mode = "400";
# owner = "forgejo";
#};
}
{ config, lib, pkgs, ... }:
{
imports =
[
./forgejo.nix
];
#services.nginx = {
# enable = true;
# recommendedProxySettings = true;
# virtualHosts."nextcloud.home" = {
# locations."/".proxyPass = "http://10.0.0.76:1234";
# listen = [{
# addr = "0.0.0.0";
# port = 1234;
# }];
# };
# virtualHosts."10.0.0.76:1234" = {
# locations."/".proxyPass = "http://127.0.0.1:1234";
# };
#};
environment.etc."nextcloud-admin-pass".text = "*****";
services.nextcloud = {
enable = false;
package = pkgs.nextcloud33;
hostName = "10.0.0.76:1234";
config = {
adminuser = "admin";
adminpassFile = "/etc/nextcloud-admin-pass";
dbtype = "sqlite";
};
extraApps = {
inherit (config.services.nextcloud.package.packages.apps) contacts calendar tasks;
};
extraAppsEnable = true;
autoUpdateApps.enable = true;
settings = {
trusted_domains = [
"http://10.0.0.76:1234"
"10.0.0.76:1234"
"localhost"
];
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment