40 lines
892 B
Nix
40 lines
892 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";
|
||
|
};
|
||
|
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";
|
||
|
};
|
||
|
}
|