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

41 lines
964 B
Nix
Raw Normal View History

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