Compare commits
10 commits
53b6772ea6
...
9131e285a8
Author | SHA1 | Date | |
---|---|---|---|
9131e285a8 | |||
38a6af903e | |||
e25f9e4868 | |||
c1f7c5b93a | |||
98192942be | |||
1522891a49 | |||
b7c9439744 | |||
ad8b7f036e | |||
ed237f2458 | |||
aa9481ba73 |
10 changed files with 99 additions and 42 deletions
7
base.nix
7
base.nix
|
@ -162,8 +162,11 @@
|
||||||
######################################## Misc. ##################################################
|
######################################## Misc. ##################################################
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
# Easiest to use and most distros use this by default.
|
networking = {
|
||||||
networking.networkmanager.enable = true;
|
# Easiest to use and most distros use this by default.
|
||||||
|
networkmanager.enable = true;
|
||||||
|
tempAddresses = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
users.mutableUsers = false; # Force all user management to happen throught nix-files
|
users.mutableUsers = false; # Force all user management to happen throught nix-files
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,16 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.ddclient = {
|
||||||
|
enable = true;
|
||||||
|
usev4 = "";
|
||||||
|
usev6 = "ifv6, ifv6=enp6s18";
|
||||||
|
username = "vsinerva.fi-dynexo";
|
||||||
|
domains = [ "exovpn.vsinerva.fi" ];
|
||||||
|
passwordFile = "/var/lib/ddclient/password";
|
||||||
|
server = "www.ovh.com";
|
||||||
|
};
|
||||||
|
|
||||||
# User worker
|
# User worker
|
||||||
users.users.worker = {
|
users.users.worker = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
|
12
machine-confs/gitea.nix
Normal file
12
machine-confs/gitea.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
networking.hostName = "gitea";
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
../base.nix
|
||||||
|
../services/gitea.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# HARDWARE SPECIFIC
|
||||||
|
services.qemuGuest.enable = true;
|
||||||
|
}
|
|
@ -2,7 +2,6 @@
|
||||||
{
|
{
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "helium";
|
hostName = "helium";
|
||||||
tempAddresses = "disabled"; # For IP-based filtering to work better
|
|
||||||
|
|
||||||
wg-quick.interfaces = {
|
wg-quick.interfaces = {
|
||||||
wg0 = {
|
wg0 = {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
{
|
{
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "lithium";
|
hostName = "lithium";
|
||||||
tempAddresses = "disabled"; # For IP-based filtering to work better
|
|
||||||
|
|
||||||
wg-quick.interfaces = {
|
wg-quick.interfaces = {
|
||||||
wg0 = {
|
wg0 = {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
../base.nix
|
../base.nix
|
||||||
# ../services/nat64.nix
|
../services/nat64.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# HARDWARE SPECIFIC
|
# HARDWARE SPECIFIC
|
||||||
|
|
64
services/gitea.nix
Normal file
64
services/gitea.nix
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
imports = [ ./acme-dns.nix ];
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
80
|
||||||
|
443
|
||||||
|
];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 443 ];
|
||||||
|
|
||||||
|
services = {
|
||||||
|
gitea = {
|
||||||
|
enable = true;
|
||||||
|
lfs.enable = true;
|
||||||
|
appName = "Gitea for Vili Sinervä";
|
||||||
|
mailerPasswordFile = "${config.services.gitea.stateDir}/smtp_pass"; # TODO
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
repository = {
|
||||||
|
ENABLE_PUSH_CREATE_USER = true;
|
||||||
|
};
|
||||||
|
ui.DEFAULT_SHOW_FULL_NAME = true;
|
||||||
|
"ui.meta".AUTHOR = "Gitea, hosted by Vili Sinervä";
|
||||||
|
server = {
|
||||||
|
DOMAIN = "gitea.vsinerva.fi";
|
||||||
|
HTTP_PORT = 8000;
|
||||||
|
ROOT_URL = "https://${config.services.gitea.settings.server.DOMAIN}";
|
||||||
|
};
|
||||||
|
service.DISABLE_REGISTRATION = true; # Disable for initial setup
|
||||||
|
session.COOKIE_SECURE = true;
|
||||||
|
mailer = {
|
||||||
|
ENABLED = true;
|
||||||
|
SMTP_ADDR = "smtp.gmail.com";
|
||||||
|
SMTP_PORT = 587;
|
||||||
|
USER = "vmsskv12@gmail.com"; # Password set in file
|
||||||
|
FROM = "gitea@vsinerva.fi";
|
||||||
|
};
|
||||||
|
cron = {
|
||||||
|
ENABLED = true;
|
||||||
|
RUN_AT_START = true;
|
||||||
|
};
|
||||||
|
time.DEFAULT_UI_LOCATION = "Europe/Helsinki";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
|
||||||
|
virtualHosts.${config.services.gitea.settings.server.DOMAIN} = {
|
||||||
|
forceSSL = true;
|
||||||
|
kTLS = true;
|
||||||
|
enableACME = true;
|
||||||
|
acmeRoot = null;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:8000";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -5,42 +5,6 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
nat64.default = {
|
nat64.default = {
|
||||||
global.pool6 = "64:ff9b::/96"; # Default value made explicit for clarity
|
global.pool6 = "64:ff9b::/96"; # Default value made explicit for clarity
|
||||||
|
|
||||||
# Port forwarding
|
|
||||||
bib = [
|
|
||||||
{
|
|
||||||
# ExoPlaSim WireGuard
|
|
||||||
"protocol" = "UDP";
|
|
||||||
"ipv4 address" = "192.168.1.2#51821";
|
|
||||||
"ipv6 address" = "fd08:d473:bcca:1:210:3292:4922:b9aa#51821";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
pool4 = [
|
|
||||||
# Ports for static BIB entries
|
|
||||||
{
|
|
||||||
protocol = "UDP";
|
|
||||||
prefix = "192.168.1.2/32";
|
|
||||||
"port range" = "51821";
|
|
||||||
}
|
|
||||||
|
|
||||||
# Port ranges for dynamic translation
|
|
||||||
{
|
|
||||||
protocol = "TCP";
|
|
||||||
prefix = "192.168.1.2/32";
|
|
||||||
"port range" = "30001-50000";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
protocol = "UDP";
|
|
||||||
prefix = "192.168.1.2/32";
|
|
||||||
"port range" = "30001-50000";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
protocol = "ICMP";
|
|
||||||
prefix = "192.168.1.2/32";
|
|
||||||
"port range" = "30001-50000";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
|
|
||||||
nginx = {
|
nginx = {
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
|
||||||
virtualHosts.${config.services.nextcloud.hostName} = {
|
virtualHosts.${config.services.nextcloud.hostName} = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
nginx = {
|
nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
|
||||||
virtualHosts."vaultwarden.vsinerva.fi" = {
|
virtualHosts."vaultwarden.vsinerva.fi" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
@ -43,7 +46,7 @@
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
acmeRoot = null;
|
acmeRoot = null;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:8000";
|
proxyPass = "http://localhost:8000";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue