2020-10-31 20:52:10 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
let
|
2021-06-06 13:15:01 +02:00
|
|
|
moodle-dl-package = pkgs.moodle-dl.overrideAttrs (old: old // {
|
2021-04-03 15:01:45 +02:00
|
|
|
patches = [ <niveum/packages/moodle-dl/telegram-format.patch> ];
|
2021-03-30 23:19:40 +02:00
|
|
|
});
|
2020-10-31 20:52:10 +01:00
|
|
|
in
|
|
|
|
|
{
|
2021-06-06 13:15:01 +02:00
|
|
|
imports = [ <niveum/modules/moodle-dl.nix> ];
|
2020-10-31 20:52:10 +01:00
|
|
|
|
2021-03-30 23:19:40 +02:00
|
|
|
services.moodle-dl = {
|
|
|
|
|
enable = true;
|
|
|
|
|
startAt = "hourly";
|
|
|
|
|
package = moodle-dl-package;
|
2021-04-03 15:01:45 +02:00
|
|
|
settings = {
|
2021-03-30 23:19:40 +02:00
|
|
|
telegram = {
|
|
|
|
|
token = lib.strings.fileContents <system-secrets/telegram/moodle-dl.token>;
|
|
|
|
|
chat_id = "18980945";
|
2021-04-28 06:16:49 +02:00
|
|
|
send_error_msg = false;
|
2021-03-30 23:19:40 +02:00
|
|
|
};
|
|
|
|
|
token = lib.strings.fileContents <system-secrets/moodle.token>;
|
|
|
|
|
moodle_domain = "moodle.hu-berlin.de";
|
|
|
|
|
moodle_path = "/";
|
|
|
|
|
download_course_ids = [
|
2021-04-09 15:45:50 +02:00
|
|
|
# WS 2020
|
2021-03-30 23:19:40 +02:00
|
|
|
99881 # Dialektologie
|
|
|
|
|
100183 # Onomastik
|
|
|
|
|
100353 # Sanskrit I
|
|
|
|
|
100692 # Sanskrit Tutorium
|
|
|
|
|
99832 # Germanisch
|
|
|
|
|
99823 # Gotisch
|
|
|
|
|
99813 # Altalbanisch
|
|
|
|
|
98681 # Geistliche Lyrik von Luther bis Lehnert
|
|
|
|
|
99667 # Antike Mythologie
|
|
|
|
|
# 52365 # FSR KlassPhil
|
2021-04-09 15:45:50 +02:00
|
|
|
|
|
|
|
|
# SS 2021
|
|
|
|
|
104850 # Metrik
|
|
|
|
|
103274 # Marc Aurel
|
|
|
|
|
102909 # Sanskrit II
|
2021-04-10 12:25:08 +02:00
|
|
|
104937 # Altirisch
|
|
|
|
|
104925 # Gradierung und Komparation
|
2021-04-10 17:24:32 +02:00
|
|
|
105264 # Was andere Sprachen anders machen
|
|
|
|
|
104991 # Warum klingt Orkisch böse
|
|
|
|
|
105074 # Litauisch
|
2021-04-12 11:10:31 +02:00
|
|
|
103685 # Griechische Sprache und Übersetzung I
|
2021-04-12 18:17:45 +02:00
|
|
|
105455 # Elegia greca
|
2021-04-13 15:09:05 +02:00
|
|
|
105335 # Homerische Epen
|
2021-10-17 20:18:59 +02:00
|
|
|
|
|
|
|
|
# WS 2021
|
|
|
|
|
108122 # Griechisch
|
|
|
|
|
107986 # Altostslavisch
|
|
|
|
|
107792 # Elegie in Rom
|
|
|
|
|
107369 # Tusculanae Disputationes
|
|
|
|
|
108586 # Griechische Religion
|
|
|
|
|
107988 # Balkanindogermanisch
|
2021-10-18 07:24:32 +02:00
|
|
|
108312 # Altnordisch
|
2021-10-19 14:35:12 +02:00
|
|
|
107281 # NLP
|
|
|
|
|
108736 # Grammatiktheorie
|
2021-10-19 14:51:43 +02:00
|
|
|
109438 # Warum klingt Orkisch böse
|
2021-10-19 19:41:04 +02:00
|
|
|
108025 # Poetik der Nordgermanen
|
2021-10-20 08:57:23 +02:00
|
|
|
107280 # Statistik
|
2021-10-20 11:40:26 +02:00
|
|
|
108350 # Attische Redner
|
2021-03-30 23:19:40 +02:00
|
|
|
];
|
|
|
|
|
download_submissions = true;
|
|
|
|
|
download_descriptions = true;
|
|
|
|
|
download_links_in_descriptions = false;
|
|
|
|
|
download_databases = false;
|
|
|
|
|
download_forums = false;
|
|
|
|
|
download_linked_files = false;
|
|
|
|
|
download_also_with_cookie = false;
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-10-31 20:52:10 +01:00
|
|
|
|
2021-09-18 15:53:21 +02:00
|
|
|
fileSystems."/export/moodle" = {
|
|
|
|
|
device = config.services.moodle-dl.directory;
|
|
|
|
|
options = [ "bind" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 2049 ];
|
|
|
|
|
|
|
|
|
|
services.nfs.server = {
|
2020-11-23 11:58:24 +01:00
|
|
|
enable = true;
|
2021-10-12 11:51:55 +02:00
|
|
|
exports = let machines = with (import <niveum/lib>).retiolumAddresses; [kabsa manakish]; in ''
|
|
|
|
|
/export ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(fsid=0)") machines}
|
|
|
|
|
/export/moodle ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(insecure,rw)") machines}
|
2021-09-18 15:53:21 +02:00
|
|
|
'';
|
2020-11-23 11:58:24 +01:00
|
|
|
};
|
2020-10-31 20:52:10 +01:00
|
|
|
}
|