basic work on cafe
This commit is contained in:
parent
403cd67696
commit
1fe3095197
28
cafe/gitea.nix
Normal file
28
cafe/gitea.nix
Normal 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
Normal file
32
cafe/host.nix
Normal 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 = [ ];
|
||||
}
|
Loading…
Reference in New Issue
Block a user