basic work on cafe

master
Rachel Lambda Samuelsson 2024-01-03 17:23:41 +01:00
parent 403cd67696
commit 1fe3095197
2 changed files with 60 additions and 0 deletions

28
cafe/gitea.nix 100644
View File

@ -0,0 +1,28 @@
{ config, pkgs, ... }:
{
services.gitea = {
enable = true;
appName = "My awesome Gitea server"; # Give the site a name
database = {
type = "sqlite3";
};
settings.server = {
DOMAIN = "localhost";
ROOT_URL = "http://localhost/";
HTTP_PORT = 3001;
};
};
# [CONTAINER]
boot.isContainer = true;
# [NETWORK]
networking.hostName = "gitea";
networking.useDHCP = false;
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 3001 ];
networking.firewall.allowedUDPPorts = [ ];
system.stateVersion = "23.11";
}

32
cafe/host.nix 100644
View File

@ -0,0 +1,32 @@
{ pkgs, ... }:
let gitea = {
host = "10.10.0.1";
local = "10.10.0.2";
};
in
{
# [CONTAINERS]
containers.gitea = {
autoStart = true;
ephemeral = true;
privateNetwork = true;
hostAddress = gitea.host;
localAddress = gitea.local;
config = ./gitea.nix;
};
# [NGINX]
services.nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"localhost" = {
locations."/".proxyPass = "http://${gitea.local}:3001";
};
};
};
# [NETWORK]
# networking.firewall.allowedTCPPorts = [ 80 ];
# networking.firewall.allowedUDPPorts = [ ];
}