1
0

Compare commits

..

No commits in common. "8612c794204115e989107ceab4681d775259c33d" and "031bd72e178d0d0d0d554cb73ced677d8a01e549" have entirely different histories.

2 changed files with 16 additions and 51 deletions

View File

@ -27,9 +27,7 @@
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
gptfdisk
htop htop
parted
tmux tmux
]; ];

View File

@ -1,50 +1,6 @@
{ lib, pkgs, ... }: { pkgs, ... }:
with lib; {
let
mixcloudSources = {
avocadoom = "https://www.mixcloud.com/avocadoom/";
b4m = "https://www.mixcloud.com/b4m/";
barbnerdy = "https://soundcloud.com/barbnerdy";
beh2342 = "https://soundcloud.com/beh2342";
couchsofa = "https://www.mixcloud.com/couchsofa/";
das-kraftfuttermischwerk = "https://soundcloud.com/das-kraftfuttermischwerk";
dj-spock = "https://www.mixcloud.com/dj_spock/";
LoungeControl = "https://www.mixcloud.com/LoungeControl/";
matthiasdamasty = "https://www.mixcloud.com/matthiasdamasty/";
sh1bumi = "https://soundcloud.com/sh1bumi";
shroombab = "https://www.mixcloud.com/shroombab/";
tasmo = "https://www.mixcloud.com/tasmo/";
vidister = "https://mixcloud.com/vidister/";
};
generateYoutubedlMixcloudUnits = source: url: (
nameValuePair "youtube-dl-mixcloud-${source}" {
serviceConfig = {
User = "data-mixcloud";
Group = "data-mixcloud";
Restart="on-failure";
};
path = [ pkgs.youtube-dl ];
script = ''
mkdir -p /data/mixcloud/${source}/
cd /data/mixcloud/${source}/
youtube-dl --ignore-errors --playlist-random --newline ${url}
'';
startAt = "*-*-* 05:05:00";
}
);
generateYoutubedlMixcloudTimers = source: url: (
nameValuePair "youtube-dl-mixcloud-${source}" {
timerConfig = {
RandomizedDelaySec = 10800;
};
}
);
in {
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"mixcloud.clerie.de" = { "mixcloud.clerie.de" = {
enableACME = true; enableACME = true;
@ -54,7 +10,6 @@ in {
basicAuthFile = "/var/src/secrets/nginx/mixcloud.htpasswd"; basicAuthFile = "/var/src/secrets/nginx/mixcloud.htpasswd";
extraConfig = '' extraConfig = ''
autoindex on; autoindex on;
autoindex_exact_size off;
''; '';
}; };
}; };
@ -68,6 +23,18 @@ in {
}; };
users.groups.data-mixcloud = {}; users.groups.data-mixcloud = {};
systemd.services = (mapAttrs' generateYoutubedlMixcloudUnits mixcloudSources); systemd.services."youtube-dl-mixcloud-couchsofa" = {
systemd.timers = (mapAttrs' generateYoutubedlMixcloudTimers mixcloudSources); 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";
};
} }