1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(moodle-dl): share via nfs

This commit is contained in:
2021-09-18 15:53:21 +02:00
parent f036e50210
commit d04c652f61
2 changed files with 22 additions and 20 deletions

View File

@@ -17,6 +17,16 @@
services.nextcloud-client.enable = true;
};
fileSystems."/media/moodle" = {
device = "zaatar.r:/moodle";
fsType = "nfs";
options = [
"x-systemd.idle-timeout=600"
"noauto"
"x-systemd.automount"
];
};
services.syncthing = rec {
enable = true;
user = "kfm";
@@ -37,10 +47,6 @@
devices = [ "wilde" "manakish" "heym" "zaatar" ];
id = "music";
};
"${cloud-dir}/moodle" = {
devices = [ "wilde" "zaatar" "manakish" ];
id = "moodle-dl";
};
};
};
};

View File

@@ -56,22 +56,18 @@ in
};
};
services.syncthing = let moodle-dl-directory = config.services.moodle-dl.directory; in {
fileSystems."/export/moodle" = {
device = config.services.moodle-dl.directory;
options = [ "bind" ];
};
networking.firewall.allowedTCPPorts = [ 2049 ];
services.nfs.server = {
enable = true;
user = "moodle-dl"; # config.users.extraUsers.moodle.name;
openDefaultPorts = true;
configDir = "${moodle-dl-directory}/.config/syncthing";
dataDir = "${moodle-dl-directory}/.config/syncthing";
declarative = rec {
cert = toString <system-secrets/syncthing/cert.pem>;
key = toString <system-secrets/syncthing/key.pem>;
devices = {
inherit ((import <niveum/lib>).syncthing.devices) wilde manakish zaatar;
};
folders.${moodle-dl-directory} = {
devices = [ "zaatar" "wilde" "manakish" ];
id = "moodle-dl";
};
};
exports = ''
/export 10.243.2.4(fsid=0) 10.243.2.85(fsid=0)
/export/moodle 10.243.2.4(insecure,rw) 10.243.2.85(insecure,rw)
'';
};
}