Move forgejo to hetznix

This commit is contained in:
Oliver Davies 2025-01-05 15:18:56 +00:00
parent 1156a9af04
commit d50f92ca1b
14 changed files with 120 additions and 99 deletions

View file

@ -15,9 +15,17 @@
./secrets.nix
./security
./services
../../users/opdavies
];
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs-2405}" ];
nix = {
extraOptions = ''
trusted-users = root opdavies
'';
nixPath = [ "nixpkgs=${inputs.nixpkgs-2405}" ];
};
networking.firewall.allowedTCPPorts = [
80

View file

@ -18,6 +18,7 @@
# TODO Refactor to use a wildcard certificate.
"2020.oliverdavies.uk"
"bootstrap-with-tailwind.oliverdavies.uk"
"code.oliverdavies.uk"
"florida-drupalcamp-tailwind-css.oliverdavies.uk"
"luke.oliverdavies.uk"
"phpsw-sculpin-demo.oliverdavies.uk"

View file

@ -1,10 +1,7 @@
{
imports = [
./acme.nix
./caddy
./forgejo.nix
./openssl.nix
];
services = {
openssh.enable = true;
};
}

View file

@ -0,0 +1,28 @@
{ config, ... }:
{
services = {
forgejo = {
enable = true;
settings = {
server = {
DOMAIN = "code.oliverdavies.uk";
HTTP_PORT = 2223;
};
service = {
DISABLE_REGISTRATION = true;
};
};
};
caddy.virtualHosts."${config.services.forgejo.settings.server.DOMAIN}" = {
useACMEHost = "oliverdavies.uk";
extraConfig = "reverse_proxy localhost:${toString config.services.forgejo.settings.server.HTTP_PORT}";
};
openssh.settings.AllowUsers = [ "forgejo" ];
};
}

View file

@ -0,0 +1,10 @@
{
services.openssh = {
enable = true;
settings = {
AllowUsers = [ "opdavies" ];
PermitRootLogin = "no";
};
};
}