1
0
nixfiles/hosts/storage-2/mixcloud.nix

41 lines
964 B
Nix

{ 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";
Restart="on-failure";
};
path = [ pkgs.youtube-dl ];
script = ''
mkdir -p /data/mixcloud/couchsofa/
cd /data/mixcloud/couchsofa/
youtube-dl --ignore-errors --playlist-random --newline https://www.mixcloud.com/couchsofa/
'';
startAt = "*-*-* 05:05:00";
};
}