Compare commits
4 commits
4d108b9464
...
4ec7f2f88c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4ec7f2f88c | ||
![]() |
5f7cb33867 | ||
![]() |
f57f9a37f6 | ||
![]() |
af2abd3cb5 |
2
ai.nix
2
ai.nix
|
@ -9,8 +9,6 @@
|
||||||
in {
|
in {
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
${domain} = {
|
${domain} = {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:9876/";
|
proxyPass = "http://localhost:9876/";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
|
|
@ -1,19 +1,13 @@
|
||||||
{ ... }:
|
{...}: let
|
||||||
|
|
||||||
let
|
|
||||||
domain = "books.sondell.org";
|
domain = "books.sondell.org";
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
#
|
#
|
||||||
services.audiobookshelf = {
|
services.audiobookshelf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 8000;
|
port = 8000;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
services.nginx.virtualHosts.${domain} = {
|
services.nginx.virtualHosts.${domain} = {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
default = true;
|
default = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:8000/";
|
proxyPass = "http://localhost:8000/";
|
||||||
|
@ -21,4 +15,3 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,7 @@
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
services.openssh.settings.PasswordAuthentication = false;
|
services.openssh.settings.PasswordAuthentication = false;
|
||||||
# services.openssh.settings.PermitRootLogin = "proh";
|
# services.openssh.settings.PermitRootLogin = "proh";
|
||||||
|
services.nginx.enable = true;
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
defaults = {
|
defaults = {
|
||||||
|
@ -181,8 +182,12 @@
|
||||||
dnsProvider = "cloudflare";
|
dnsProvider = "cloudflare";
|
||||||
# # location of your CLOUDFLARE_DNS_API_TOKEN=[value]
|
# # location of your CLOUDFLARE_DNS_API_TOKEN=[value]
|
||||||
# # https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile=
|
# # https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile=
|
||||||
environmentFile = "/etc/nixos/.secrets/cloudflare_dns_tokend";
|
environmentFile = "/etc/nixos/.secrets/cloudflare_zone_dns_edit";
|
||||||
};
|
};
|
||||||
|
# certs."sondell.org" = {
|
||||||
|
# domain = "*.sondell.org";
|
||||||
|
# group = config.services.nginx.group;
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
|
|
22
coturn.nix
22
coturn.nix
|
@ -44,23 +44,22 @@
|
||||||
# open the firewall
|
# open the firewall
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
interfaces.enp2s0 = let
|
interfaces.enp2s0 = let
|
||||||
range = with config.services.coturn; [ {
|
range = with config.services.coturn; [
|
||||||
from = min-port;
|
{
|
||||||
to = max-port;
|
from = min-port;
|
||||||
} ];
|
to = max-port;
|
||||||
in
|
}
|
||||||
{
|
];
|
||||||
|
in {
|
||||||
allowedUDPPortRanges = range;
|
allowedUDPPortRanges = range;
|
||||||
allowedUDPPorts = [ 3478 5349 ];
|
allowedUDPPorts = [3478 5349];
|
||||||
allowedTCPPortRanges = [ ];
|
allowedTCPPortRanges = [];
|
||||||
allowedTCPPorts = [ 3478 5349 ];
|
allowedTCPPorts = [3478 5349];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts."turn.sondell.org" = {
|
virtualHosts."turn.sondell.org" = {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# get a certificate
|
# get a certificate
|
||||||
|
@ -82,4 +81,3 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
dufs.nix
2
dufs.nix
|
@ -36,8 +36,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts.${domain} = {
|
services.nginx.virtualHosts.${domain} = {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:${port}/";
|
proxyPass = "http://localhost:${port}/";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
|
|
@ -17,8 +17,6 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts.${domain} = {
|
services.nginx.virtualHosts.${domain} = {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:${toString port}/";
|
proxyPass = "http://localhost:${toString port}/";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
|
|
@ -35,8 +35,6 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts.${domain} = {
|
services.nginx.virtualHosts.${domain} = {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:8080/";
|
proxyPass = "http://localhost:8080/";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
|
21
forgejo.nix
21
forgejo.nix
|
@ -21,6 +21,25 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.restic.backups = {
|
||||||
|
"forgejo" = {
|
||||||
|
passwordFile = "/etc/nixos/.secrets/restic_pw";
|
||||||
|
repository = "sftp:Glenn@nas:/home/back/vaultwarden/restic";
|
||||||
|
initialize = true;
|
||||||
|
paths = [
|
||||||
|
"/var/lib/forgejo"
|
||||||
|
];
|
||||||
|
user = "root";
|
||||||
|
timerConfig.OnCalendar = "02:05";
|
||||||
|
pruneOpts = [
|
||||||
|
"--keep-daily 10"
|
||||||
|
"--keep-weekly 5"
|
||||||
|
"--keep-monthly 12"
|
||||||
|
"--keep-yearly 75"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = let
|
environment.systemPackages = let
|
||||||
cfg = config.services.forgejo;
|
cfg = config.services.forgejo;
|
||||||
forgejo-cli = pkgs.writeScriptBin "forgejo-cli" ''
|
forgejo-cli = pkgs.writeScriptBin "forgejo-cli" ''
|
||||||
|
@ -49,8 +68,6 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts.${domain} = {
|
services.nginx.virtualHosts.${domain} = {
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:3000/";
|
proxyPass = "http://localhost:3000/";
|
||||||
};
|
};
|
||||||
|
|
45
homepage.nix
45
homepage.nix
|
@ -1,31 +1,28 @@
|
||||||
{ homepage, ... }:
|
{homepage, ...}: let
|
||||||
|
domain1 = "sondell.org";
|
||||||
let
|
domain2 = "start.sondell.org";
|
||||||
domain = "sondell.org";
|
|
||||||
port = "8118";
|
port = "8118";
|
||||||
in
|
hostSettings = {
|
||||||
{
|
|
||||||
systemd.services.homepage = {
|
|
||||||
enable = true;
|
|
||||||
description = "homepage with links to selfhosted services";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
unitConfig = {
|
|
||||||
After="network-online.target";
|
|
||||||
};
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${homepage}/bin/home-prod -p ${port}";
|
|
||||||
User= "sondell";
|
|
||||||
Type= "simple";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts.${domain} = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:${port}/";
|
proxyPass = "http://localhost:${port}/";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
in {
|
||||||
|
systemd.services.homepage = {
|
||||||
|
enable = true;
|
||||||
|
description = "homepage with links to selfhosted services";
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
unitConfig = {
|
||||||
|
After = "network-online.target";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${homepage}/bin/home-prod -p ${port}";
|
||||||
|
User = "sondell";
|
||||||
|
Type = "simple";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts.${domain1} = hostSettings;
|
||||||
|
services.nginx.virtualHosts.${domain2} = hostSettings;
|
||||||
|
}
|
||||||
|
|
13
jellyfin.nix
13
jellyfin.nix
|
@ -1,23 +1,16 @@
|
||||||
{ config, ... }:
|
{config, ...}: let
|
||||||
|
|
||||||
let
|
|
||||||
domain = "jelly.sondell.org";
|
domain = "jelly.sondell.org";
|
||||||
# derp = "hi";
|
# derp = "hi";
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
#
|
#
|
||||||
services.jellyfin = {
|
services.jellyfin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
services.nginx.virtualHosts.${domain} = {
|
services.nginx.virtualHosts.${domain} = {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:8096/";
|
proxyPass = "http://localhost:8096/";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
39
matrix.nix
39
matrix.nix
|
@ -1,6 +1,8 @@
|
||||||
{ config, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
let
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
domain = "sondell.org";
|
domain = "sondell.org";
|
||||||
hostName = "matrix";
|
hostName = "matrix";
|
||||||
fqdn = "${hostName}.${domain}";
|
fqdn = "${hostName}.${domain}";
|
||||||
|
@ -12,8 +14,7 @@ let
|
||||||
add_header Access-Control-Allow-Origin *;
|
add_header Access-Control-Allow-Origin *;
|
||||||
return 200 '${builtins.toJSON data}';
|
return 200 '${builtins.toJSON data}';
|
||||||
'';
|
'';
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
#
|
#
|
||||||
services.matrix-synapse = {
|
services.matrix-synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -29,31 +30,27 @@ in
|
||||||
x_forwarded = true;
|
x_forwarded = true;
|
||||||
resources = [
|
resources = [
|
||||||
{
|
{
|
||||||
names = [ "client" "federation" ];
|
names = ["client" "federation"];
|
||||||
compress = true;
|
compress = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.postgresql = {
|
||||||
services.postgresql = {
|
enable = true;
|
||||||
enable = true;
|
initialScript = pkgs.writeText "synapse-init.sql" ''
|
||||||
initialScript = pkgs.writeText "synapse-init.sql" ''
|
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
|
||||||
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
|
CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
|
||||||
CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
|
TEMPLATE template0
|
||||||
TEMPLATE template0
|
LC_COLLATE = "C"
|
||||||
LC_COLLATE = "C"
|
LC_CTYPE = "C";
|
||||||
LC_CTYPE = "C";
|
'';
|
||||||
'';
|
};
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
${fqdn} = {
|
${fqdn} = {
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
# locations."/".extraConfig = ''
|
# locations."/".extraConfig = ''
|
||||||
# return 404;
|
# return 404;
|
||||||
# '';
|
# '';
|
||||||
|
@ -66,7 +63,6 @@ services.postgresql = {
|
||||||
|
|
||||||
${domain} = {
|
${domain} = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
|
||||||
# locations."/" = {
|
# locations."/" = {
|
||||||
# proxyPass = "http://localhost:8008";
|
# proxyPass = "http://localhost:8008";
|
||||||
# };
|
# };
|
||||||
|
@ -83,4 +79,3 @@ services.postgresql = {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,10 +64,10 @@ in {
|
||||||
|
|
||||||
nginx.virtualHosts = {
|
nginx.virtualHosts = {
|
||||||
${domain} = {
|
${domain} = {
|
||||||
forceSSL = true;
|
# forceSSL = true;
|
||||||
enableACME = true;
|
# enableACME = true;
|
||||||
# Use DNS Challenege.
|
# # Use DNS Challenege.
|
||||||
# acmeRoot = null;
|
# # acmeRoot = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
postgresql.enable = true;
|
postgresql.enable = true;
|
||||||
|
@ -90,6 +90,9 @@ in {
|
||||||
# Let NixOS install and configure Redis caching automatically.
|
# Let NixOS install and configure Redis caching automatically.
|
||||||
configureRedis = true;
|
configureRedis = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
trusted_proxies = [
|
||||||
|
"192.168.1.199"
|
||||||
|
];
|
||||||
maintenance_window_start = 1;
|
maintenance_window_start = 1;
|
||||||
};
|
};
|
||||||
extraOptions = {
|
extraOptions = {
|
||||||
|
@ -112,7 +115,7 @@ in {
|
||||||
inherit mail calendar contacts notes onlyoffice cookbook spreed memories previewgenerator;
|
inherit mail calendar contacts notes onlyoffice cookbook spreed memories previewgenerator;
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
overwriteProtocol = "https";
|
# overwriteProtocol = "https";
|
||||||
defaultPhoneRegion = "SE";
|
defaultPhoneRegion = "SE";
|
||||||
dbtype = "pgsql";
|
dbtype = "pgsql";
|
||||||
adminuser = "admin";
|
adminuser = "admin";
|
||||||
|
@ -138,8 +141,8 @@ in {
|
||||||
jwtSecretFile = "/etc/nixos/.secrets/onlyoffice.jwt";
|
jwtSecretFile = "/etc/nixos/.secrets/onlyoffice.jwt";
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts."office.sondell.org" = {
|
services.nginx.virtualHosts."office.sondell.org" = {
|
||||||
forceSSL = true;
|
# forceSSL = true;
|
||||||
enableACME = true;
|
# enableACME = true;
|
||||||
# locations."/".proxyPass = "http://12:8123";
|
# locations."/".proxyPass = "http://localhost:8123";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts.${domain} = {
|
services.nginx.virtualHosts.${domain} = {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:${port}/";
|
proxyPass = "http://localhost:${port}/";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue