Add mixcloud mirror
This commit is contained in:
parent
3d588080bc
commit
e6876d95d1
@ -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";
|
||||
|
39
hosts/storage-2/mixcloud.nix
Normal file
39
hosts/storage-2/mixcloud.nix
Normal 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";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user