added forgejo config using sqlite.

This commit is contained in:
Gabe Venberg 2024-07-29 15:02:40 -05:00
parent 6dcbb146b7
commit f91cb5469d
8 changed files with 77 additions and 32 deletions

41
configs/nixos/forgejo.nix Normal file
View file

@ -0,0 +1,41 @@
{
inputs,
config,
pkgs,
lib,
...
}: let
cfg = config.services.forgejo;
srv = cfg.settings.server;
in {
services.forgejo = {
enable = true;
database.type = "sqlite3";
lfs.enable = true;
settings = {
server = {
DOMAIN = "test.venberg.xyz";
ROOT_URL = "https://${srv.DOMAIN}";
HTTP_PORT = 3000;
ENABLE_GZIP = true;
};
service.DISABLE_REGISTRATION = true;
ui.DEFAULT_THEME = "forgejo-dark";
log.LEVEL = "Warn";
"cron.git_gc_repos".ENABLED = true;
"cron.resync_all_sshkeys".ENABLED = true;
"cron.reinit_missing_repos".ENABLED = true;
"cron.delete_old_actions".ENABLED = true;
"cron.delete_old_system_notices".ENABLED = true;
"cron.gc_lfs".ENABLED = true;
};
};
services.nginx.virtualHosts.${srv.DOMAIN} = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
};
};
}

View file

@ -8,9 +8,6 @@
services.radicale = { services.radicale = {
enable = true; enable = true;
settings = { settings = {
server={
hosts=[ "0.0.0.0:5232" "[::]:5232" ];
};
auth = { auth = {
type = "htpasswd"; type = "htpasswd";
htpasswd_encryption = "md5"; htpasswd_encryption = "md5";
@ -19,4 +16,12 @@
}; };
}; };
networking.firewall.allowedTCPPorts = [5232]; networking.firewall.allowedTCPPorts = [5232];
services.nginx.virtualHosts."cal.venberg.xyz" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:5232";
};
};
} }

View file

@ -19,6 +19,7 @@ inputs.nixpkgs.lib.nixosSystem {
../../configs/nixos/sshd.nix ../../configs/nixos/sshd.nix
../../configs/nixos/secrets.nix ../../configs/nixos/secrets.nix
../../configs/nixos/radicale.nix ../../configs/nixos/radicale.nix
# ../../configs/nixos/forgejo.nix
({ ({
config, config,
pkgs, pkgs,

View file

@ -35,4 +35,3 @@
}; };
}; };
} }

View file

@ -8,12 +8,10 @@
imports = [ imports = [
../../configs/nixos/nginx.nix ../../configs/nixos/nginx.nix
]; ];
services.nginx.virtualHosts."cal.venberg.xyz" = { services.nginx.virtualHosts."gabevenberg.com" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { root = "/var/www/gabevenberg.com";
proxyPass = "http://localhost:5232";
};
}; };
networking.firewall.allowedTCPPorts = [443 80]; networking.firewall.allowedTCPPorts = [443 80];
} }

View file

@ -1,8 +1,6 @@
{lib}: let {lib}: let
net = import ./net.nix {inherit lib;}; net = import ./net.nix {inherit lib;};
in in {
{
dirToStrings = dir: (map (v: builtins.readFile "${dir}/${v}") dirToStrings = dir: (map (v: builtins.readFile "${dir}/${v}")
(builtins.filter (v: (builtins.filter (v:
(builtins.readFileType "${dir}/${v}") == "regular") ( (builtins.readFileType "${dir}/${v}") == "regular") (
@ -14,8 +12,11 @@ in
else [] else []
))); )));
calcSystemdDhcpPoolOffset = {
calcSystemdDhcpPoolOffset = {base, start, end}: { base,
start,
end,
}: {
offset = net.lib.net.ip.diff start base; offset = net.lib.net.ip.diff start base;
size = net.lib.net.ip.diff end start; size = net.lib.net.ip.diff end start;
}; };