Begin the move to the import all, activate by config model
This commit is contained in:
parent
7397b614de
commit
07cb2d67a2
97 changed files with 776 additions and 633 deletions
20
modules/system/services/server/nginx/default.nix
Normal file
20
modules/system/services/server/nginx/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./rtmp
|
||||
./virtualhosts
|
||||
];
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
];
|
||||
}
|
27
modules/system/services/server/nginx/rtmp/default.nix
Normal file
27
modules/system/services/server/nginx/rtmp/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
package = (pkgs.nginx.override {
|
||||
modules = with pkgs.nginxModules; [ rtmp ];
|
||||
});
|
||||
appendConfig = ''
|
||||
rtmp {
|
||||
server {
|
||||
listen 1935;
|
||||
chunk_size 4096;
|
||||
allow publish all;
|
||||
application stream {
|
||||
record off;
|
||||
live on;
|
||||
allow play all;
|
||||
hls on;
|
||||
hls_path /var/www/Jimbo-Landing-Page/streams/hls/;
|
||||
hls_fragment_naming system;
|
||||
hls_fragment 3;
|
||||
hls_playlist_length 40;
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./jimDomain1
|
||||
];
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts = {
|
||||
"${config.domains.jim1}" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
root = "/var/www/Jimbo-Landing-Page";
|
||||
locations = {
|
||||
"/.well-known/matrix/client" = {
|
||||
extraConfig = ''
|
||||
default_type application/json;
|
||||
return 200 '
|
||||
{
|
||||
"m.homeserver": {
|
||||
"base_url": "https://matrix.${config.domains.jim1}"
|
||||
},
|
||||
"m.identity_server": {
|
||||
"base_url": "https://matrix.org"
|
||||
},
|
||||
"org.matrix.msc3575.proxy": {
|
||||
"url": "https://matrix.${config.domains.jim1}"
|
||||
}
|
||||
}';
|
||||
'';
|
||||
};
|
||||
"/.well-known/matrix/server" = {
|
||||
extraConfig = ''
|
||||
default_type application/json;
|
||||
return 200 '{"m.server": "matrix.${config.domains.jim1}:443"}';
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue