nixos-server/host.nix

44 lines
919 B
Nix
Raw Normal View History

2024-05-23 10:59:42 +02:00
{ pkgs, ... }:
let gitea = {
host = "10.10.0.1";
local = "10.10.0.2";
};
2024-05-23 11:21:24 +02:00
secrets = import ./secrets/secrets.nix;
2024-05-23 10:59:42 +02:00
in
{
# [CONTAINERS]
containers.gitea = {
autoStart = true;
ephemeral = true;
privateNetwork = true;
hostAddress = gitea.host;
localAddress = gitea.local;
2024-05-23 11:21:24 +02:00
config = ./guests/gitea.nix;
2024-05-23 10:59:42 +02:00
};
# [NGINX]
services.nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"localhost" = {
locations."/".proxyPass = "http://${gitea.local}:3001";
};
};
};
# [NETWORK]
networking.firewall.allowedTCPPorts = [ 80 ];
networking.firewall.allowedUDPPorts = [ ];
# VM test user
2024-05-23 11:21:24 +02:00
users.users.admin.isSystemUser = true ;
users.users.admin.hashedPassword = builtins.readFile ./secrets/admin_password;
users.users.admin.group = "admin";
users.groups.admin = {};
2024-05-23 10:59:42 +02:00
system.stateVersion = "23.11";
}