Compare commits
4 Commits
5942c97c1c
...
97fbec56b1
| Author | SHA1 | Date | |
|---|---|---|---|
| 97fbec56b1 | |||
| 7ff5fb0da2 | |||
| b6e8297085 | |||
| 8864af1ddf |
@@ -4,6 +4,7 @@
|
|||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
self,
|
self,
|
||||||
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@@ -93,6 +94,22 @@ in
|
|||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
|
|
||||||
firewall.enable = true;
|
firewall.enable = true;
|
||||||
|
|
||||||
|
extraHosts =
|
||||||
|
let
|
||||||
|
subdomains = [ "" ".git" ];
|
||||||
|
in
|
||||||
|
builtins.foldl' (
|
||||||
|
hosts-acc: domain-prefix:
|
||||||
|
let
|
||||||
|
host = "${domain-prefix}${config.networking.fqdn}";
|
||||||
|
in
|
||||||
|
hosts-acc
|
||||||
|
+ ''
|
||||||
|
127.0.0.1 ${host}
|
||||||
|
::1 ${host}
|
||||||
|
''
|
||||||
|
) "" subdomains;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.podman.enable = true;
|
virtualisation.podman.enable = true;
|
||||||
|
|||||||
@@ -31,5 +31,7 @@ in
|
|||||||
{
|
{
|
||||||
flake.nixosConfigurations = {
|
flake.nixosConfigurations = {
|
||||||
tuxcord-ca = mkSystem "tuxcord-ca" "x86_64-linux";
|
tuxcord-ca = mkSystem "tuxcord-ca" "x86_64-linux";
|
||||||
|
|
||||||
|
tuxcord-test = mkSystem "tuxcord-test" "x86_64-linux";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,5 +4,6 @@
|
|||||||
./storage.nix
|
./storage.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
networking.fqdn = "tuxcord.net";
|
||||||
time.timeZone = "Canada/Eastern";
|
time.timeZone = "Canada/Eastern";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
networking.fqdn = "tuxcord.test";
|
||||||
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./fail2ban.nix
|
./fail2ban.nix
|
||||||
./sysctl.nix
|
./gitea.nix
|
||||||
./host.nix
|
./host.nix
|
||||||
|
./nginx.nix
|
||||||
./snapper.nix
|
./snapper.nix
|
||||||
./substituters.nix
|
./substituters.nix
|
||||||
|
./sysctl.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
services.gitea = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
appName = "Tuxcord's Gitea";
|
||||||
|
database.type = "mysql";
|
||||||
|
|
||||||
|
lfs.enable = true;
|
||||||
|
|
||||||
|
settings.server.DOMAIN = config.networking.fqdn;
|
||||||
|
# settings.server.ROOT_URL = "https://git.tuxcord.net/"; ? would also depend on ssl status
|
||||||
|
settings.server.HTTP_PORT = 3000;
|
||||||
|
|
||||||
|
settings.service.DISABLE_REGISTRATION = true;
|
||||||
|
settings.service.REQUIRE_SIGNIN_VIEW = false;
|
||||||
|
|
||||||
|
settings.repository.ENABLE_PUSH_CREATE_USER = true;
|
||||||
|
settings.repository.ENABLE_PUSH_CREATE_ORG = true;
|
||||||
|
settings.repository.DEFAULT_BRANCH = "main";
|
||||||
|
|
||||||
|
# settings.ui.DEFAULT_THEME = "...";
|
||||||
|
|
||||||
|
# TODO: once we have email setup this would be nice
|
||||||
|
settings.mailer.ENABLED = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (config.networking) fqdn;
|
||||||
|
|
||||||
|
mkVhost =
|
||||||
|
attrs:
|
||||||
|
{
|
||||||
|
forceSSL = false; # TODO: tweak per host
|
||||||
|
}
|
||||||
|
// attrs;
|
||||||
|
|
||||||
|
mkProxy = port: {
|
||||||
|
proxyPass = "http://127.0.0.1:${toString port}/";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
80
|
||||||
|
443
|
||||||
|
];
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
|
||||||
|
# services.nginx.virtualHosts."${fqdn}" = {
|
||||||
|
# addSSL = true;
|
||||||
|
# root = "/var/www/myhost.org";
|
||||||
|
# default = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
virtualHosts."git.${fqdn}" = mkVhost {
|
||||||
|
locations."/" = mkProxy config.services.gitea.settings.server.HTTP_PORT;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user