Compare commits
No commits in common. "64a1924f4a58318207fc4ef684a974bbe68f842d" and "fd730f837c7841a96611004efdabca6c4268499c" have entirely different histories.
64a1924f4a
...
fd730f837c
@ -8,7 +8,6 @@
|
||||
./bubblesort.nix
|
||||
./ip.nix
|
||||
./meow.nix
|
||||
./znc.nix
|
||||
];
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
|
@ -1,29 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.znc = {
|
||||
enable = true;
|
||||
mutable = true;
|
||||
dataDir = "/var/lib/znc";
|
||||
configFile = "/var/lib/znc/configs/znc.conf";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts = {
|
||||
"znc.clerie.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:1313";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
clerie.nginx-port-forward = {
|
||||
enable = true;
|
||||
tcpPorts."6697" = {
|
||||
host = "127.0.0.1";
|
||||
port = 1311;
|
||||
certName = "znc.clerie.de";
|
||||
};
|
||||
};
|
||||
}
|
@ -4,20 +4,11 @@ with lib;
|
||||
|
||||
let
|
||||
cfg = config.clerie.nginx-port-forward;
|
||||
certs = config.security.acme.certs;
|
||||
sslDhparam = config.services.nginx.sslDhparam;
|
||||
|
||||
mkServerBlock = isUDP: port: forward: ''
|
||||
server {
|
||||
listen ${port}${optionalString isUDP " udp"}${optionalString (forward.certName != null) " ssl"};
|
||||
listen [::]:${port}${optionalString isUDP " udp"}${optionalString (forward.certName != null) " ssl"};
|
||||
|
||||
${ optionalString (forward.certName != null) ''
|
||||
ssl_certificate ${certs.${forward.certName}.directory}/fullchain.pem;
|
||||
ssl_certificate_key ${certs.${forward.certName}.directory}/key.pem;
|
||||
${ optionalString (sslDhparam != null) "ssl_dhparam ${sslDhparam};" }
|
||||
'' }
|
||||
|
||||
listen ${port}${optionalString isUDP " udp"};
|
||||
listen [::]:${port}${optionalString isUDP " udp"};
|
||||
proxy_pass ${forward.host}:${toString forward.port};
|
||||
}
|
||||
'';
|
||||
@ -37,10 +28,6 @@ let
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
};
|
||||
certName = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user