1
0

Add mixcloud mirror

This commit is contained in:
clerie 2022-01-02 21:55:09 +01:00
parent 3d588080bc
commit e6876d95d1
2 changed files with 44 additions and 0 deletions

View File

@ -6,6 +6,7 @@
./hardware-configuration.nix
../../configuration/common
../../configuration/proxmox-vm
./mixcloud.nix
];
boot.loader.grub.enable = true;
@ -23,6 +24,10 @@
networking.defaultGateway6 = { address = "2001:638:904:ffc0::1"; interface = "ens18"; };
networking.nameservers = [ "2001:638:904:ffcc::3" "2001:638:904:ffcc::4" "141.24.40.3" "141.24.40.4" ];
services.nginx.enable = true;
networking.firewall.allowedTCPPorts = [ 80 443 ];
clerie.monitoring = {
enable = true;
id = "209";

View File

@ -0,0 +1,39 @@
{ pkgs, ... }:
{
services.nginx.virtualHosts = {
"mixcloud.clerie.de" = {
enableACME = true;
forceSSL = true;
locations."/" = {
alias = "/data/mixcloud/";
basicAuthFile = "/var/src/secrets/nginx/mixcloud.htpasswd";
extraConfig = ''
autoindex on;
'';
};
};
};
users.users.data-mixcloud = {
group = "data-mixcloud";
home = "/data/mixcloud";
useDefaultShell = true;
isSystemUser = true;
};
users.groups.data-mixcloud = {};
systemd.services."youtube-dl-mixcloud-couchsofa" = {
serviceConfig = {
User = "data-mixcloud";
Group = "data-mixcloud";
};
path = [ pkgs.youtube-dl ];
script = ''
mkdir -p /data/mixcloud/couchsofa/
cd /data/mixcloud/couchsofa/
youtube-dl https://www.mixcloud.com/couchsofa/
'';
startAt = "*-*-* 05:05:00";
};
}