Separate some more files and extrapolate more non-secrets
This commit is contained in:
parent
83796f7cb2
commit
7f512583e0
9 changed files with 122 additions and 103 deletions
|
@ -1,45 +1,31 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
services = {
|
||||
nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud29;
|
||||
hostName = "cloud.${config.domains.jim1}";
|
||||
datadir = "/mnt/nextcloud";
|
||||
https = true;
|
||||
config = {
|
||||
adminuser = "jimbo";
|
||||
adminpassFile = "/mnt/nextcloud/password.txt";
|
||||
};
|
||||
settings = {
|
||||
trusted_proxies = [ "127.0.0.1" ];
|
||||
trusted_domains = [ "cloud.${config.domains.jim1}" ];
|
||||
overwriteprotocol = "https";
|
||||
mail_smtphost = "mx.${config.domains.jim1}";
|
||||
mail_domain = "${config.domains.jim1}";
|
||||
mail_from_address = "noreply";
|
||||
mail_smtpauth = "true";
|
||||
mail_smtpname = "noreply@${config.domains.jim1}";
|
||||
mail_smtppassword = config.secrets.noreplyPassword;
|
||||
mail_smtpmode = "smtp";
|
||||
mail_smtpport = 587;
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
./nginx
|
||||
];
|
||||
|
||||
nginx.virtualHosts."cloud.${config.domains.jim1}" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
locations."/" = {
|
||||
proxyWebsockets = true;
|
||||
extraConfig = "
|
||||
location /.well-known/carddav {
|
||||
return 301 $scheme://$host/remote.php/dav;
|
||||
}
|
||||
location /.well-known/caldav {
|
||||
return 301 $scheme://$host/remote.php/dav;
|
||||
}
|
||||
";
|
||||
};
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud29;
|
||||
hostName = "cloud.${config.domains.jim1}";
|
||||
datadir = "/mnt/nextcloud";
|
||||
https = true;
|
||||
config = {
|
||||
adminuser = "jimbo";
|
||||
adminpassFile = "/mnt/nextcloud/password.txt";
|
||||
};
|
||||
settings = {
|
||||
trusted_proxies = [ "127.0.0.1" ];
|
||||
trusted_domains = [ "cloud.${config.domains.jim1}" ];
|
||||
overwriteprotocol = "https";
|
||||
mail_smtphost = "mx.${config.domains.jim1}";
|
||||
mail_domain = "${config.domains.jim1}";
|
||||
mail_from_address = "noreply";
|
||||
mail_smtpauth = "true";
|
||||
mail_smtpname = "noreply@${config.domains.jim1}";
|
||||
mail_smtppassword = config.secrets.noreplyPassword;
|
||||
mail_smtpmode = "smtp";
|
||||
mail_smtpport = 587;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."cloud.${config.domains.jim1}" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
locations."/" = {
|
||||
proxyWebsockets = true;
|
||||
extraConfig = "
|
||||
location /.well-known/carddav {
|
||||
return 301 $scheme://$host/remote.php/dav;
|
||||
}
|
||||
location /.well-known/caldav {
|
||||
return 301 $scheme://$host/remote.php/dav;
|
||||
}
|
||||
";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,5 +1,9 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./nginx
|
||||
];
|
||||
|
||||
services = {
|
||||
photoprism = {
|
||||
enable = true;
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."gallery.${config.domains.jim1}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:2342";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -2,64 +2,34 @@
|
|||
{
|
||||
imports = [
|
||||
./nginx
|
||||
./liquidsoap
|
||||
];
|
||||
|
||||
services = {
|
||||
icecast = {
|
||||
enable = true;
|
||||
listen.port = 265;
|
||||
hostname = "icecast.${config.domains.jim1}";
|
||||
admin = {
|
||||
user = "jimbo";
|
||||
password = "${config.secrets.castAdminPass}";
|
||||
};
|
||||
extraConf = ''
|
||||
<authentication>
|
||||
<source-password>${config.secrets.castSourcePass}</source-password>
|
||||
</authentication>
|
||||
|
||||
<location>Canada</location>
|
||||
<admin>jimbo@${config.domains.jim2}</admin>
|
||||
|
||||
<mount type="normal">
|
||||
<mount-name>/jimbops.opus</mount-name>
|
||||
<stream-name>JimBops Radio</stream-name>
|
||||
<stream-description>Music gathered by me, Jimbo.</stream-description>
|
||||
<stream-url>https://icecast.jimbosfiles.com/jimbops.opus</stream-url>
|
||||
<genre>Anything</genre>
|
||||
<type>application/ogg</type>
|
||||
<subtype>vorbis</subtype>
|
||||
</mount>
|
||||
'';
|
||||
};
|
||||
|
||||
# The audio stream
|
||||
liquidsoap.streams = {
|
||||
jimbops = pkgs.writeText "liquidjim" ''
|
||||
settings.log.stdout.set(true)
|
||||
settings.init.allow_root.set(true)
|
||||
settings.scheduler.fast_queues.set(2)
|
||||
settings.decoder.file_extensions.mp4.set(["m4a", "m4b", "m4p", "m4v", "m4r", "3gp", "mp4"])
|
||||
|
||||
# Define the source with random playlist
|
||||
jimbops = mksafe(playlist(mode='randomize', reload=1, reload_mode="rounds", "/export/JimboNFS/Music/"))
|
||||
|
||||
# Ensure the stream never stops
|
||||
jimbops_fallback = fallback([jimbops, jimbops])
|
||||
|
||||
# Output configuration to Icecast
|
||||
output.icecast(
|
||||
%ffmpeg(format="ogg", %audio(codec="libvorbis", samplerate=48000, b="256k", channels=2)),
|
||||
host="127.0.0.1",
|
||||
port=265,
|
||||
password="${config.secrets.castSourcePass}",
|
||||
public=true,
|
||||
icy_metadata=["artist", "title"],
|
||||
mount="jimbops.opus",
|
||||
encoding = "UTF-8",
|
||||
jimbops_fallback
|
||||
)
|
||||
'';
|
||||
services.icecast = {
|
||||
enable = true;
|
||||
listen.port = 265;
|
||||
hostname = "icecast.${config.domains.jim1}";
|
||||
admin = {
|
||||
user = "jimbo";
|
||||
password = "${config.secrets.castAdminPass}";
|
||||
};
|
||||
extraConf = ''
|
||||
<authentication>
|
||||
<source-password>${config.secrets.castSourcePass}</source-password>
|
||||
</authentication>
|
||||
|
||||
<location>Canada</location>
|
||||
<admin>jimbo@${config.domains.jim2}</admin>
|
||||
|
||||
<mount type="normal">
|
||||
<mount-name>/jimbops.opus</mount-name>
|
||||
<stream-name>JimBops Radio</stream-name>
|
||||
<stream-description>Music gathered by me, Jimbo.</stream-description>
|
||||
<stream-url>https://icecast.jimbosfiles.com/jimbops.opus</stream-url>
|
||||
<genre>Anything</genre>
|
||||
<type>application/ogg</type>
|
||||
<subtype>vorbis</subtype>
|
||||
</mount>
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
services.liquidsoap.streams = {
|
||||
jimbops = pkgs.writeText "liquidjim" ''
|
||||
settings.log.stdout.set(true)
|
||||
settings.init.allow_root.set(true)
|
||||
settings.scheduler.fast_queues.set(2)
|
||||
settings.decoder.file_extensions.mp4.set(["m4a", "m4b", "m4p", "m4v", "m4r", "3gp", "mp4"])
|
||||
|
||||
# Define the source with random playlist
|
||||
jimbops = mksafe(playlist(mode='randomize', reload=1, reload_mode="rounds", "/export/JimboNFS/Music/"))
|
||||
|
||||
# Ensure the stream never stops
|
||||
jimbops_fallback = fallback([jimbops, jimbops])
|
||||
|
||||
# Output configuration to Icecast
|
||||
output.icecast(
|
||||
%ffmpeg(format="ogg", %audio(codec="libvorbis", samplerate=48000, b="256k", channels=2)),
|
||||
host="127.0.0.1",
|
||||
port=265,
|
||||
password="${config.secrets.castSourcePass}",
|
||||
public=true,
|
||||
icy_metadata=["artist", "title"],
|
||||
mount="jimbops.opus",
|
||||
encoding = "UTF-8",
|
||||
jimbops_fallback
|
||||
)
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue