2024-03-17 18:48:49 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
2024-01-17 09:33:42 +00:00
|
|
|
}:
|
|
|
|
{
|
2024-01-19 15:59:32 +00:00
|
|
|
# Integration can be improved, if the following issues get implemented:
|
|
|
|
# - cli frontend: https://github.com/localsend/localsend/issues/11
|
|
|
|
# - ipv6 support: https://github.com/localsend/localsend/issues/549
|
2024-01-17 09:33:42 +00:00
|
|
|
options.clan.localsend = {
|
2024-05-28 11:35:11 +00:00
|
|
|
enable = lib.mkEnableOption "enable the localsend module";
|
2024-01-17 09:33:42 +00:00
|
|
|
defaultLocation = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "The default download location";
|
|
|
|
};
|
|
|
|
package = lib.mkPackageOption pkgs "localsend" { };
|
|
|
|
};
|
|
|
|
|
2024-03-27 09:47:24 +00:00
|
|
|
config = lib.mkIf config.clan.localsend.enable {
|
|
|
|
clanCore.state.localsend.folders = [
|
|
|
|
"/var/localsend"
|
|
|
|
config.clan.localsend.defaultLocation
|
|
|
|
];
|
|
|
|
environment.systemPackages = [ config.clan.localsend.package ];
|
2024-01-17 09:33:42 +00:00
|
|
|
|
2024-03-27 09:47:24 +00:00
|
|
|
networking.firewall.interfaces."zt+".allowedTCPPorts = [ 53317 ];
|
|
|
|
networking.firewall.interfaces."zt+".allowedUDPPorts = [ 53317 ];
|
2024-01-17 09:33:42 +00:00
|
|
|
|
2024-03-27 09:47:24 +00:00
|
|
|
#TODO: This is currently needed because there is no ipv6 multicasting support yet
|
|
|
|
#
|
|
|
|
systemd.network.networks."09-zerotier" = {
|
|
|
|
networkConfig = {
|
|
|
|
Address = "192.168.56.2/24";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-01-17 09:33:42 +00:00
|
|
|
}
|