clan-core/clanModules/localsend/default.nix

39 lines
1.1 KiB
Nix
Raw Normal View History

2024-03-17 18:48:49 +00:00
{
config,
pkgs,
lib,
...
2024-01-17 09:33:42 +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" { };
};
config = lib.mkIf config.clan.localsend.enable {
2024-06-17 10:42:28 +00:00
clan.core.state.localsend.folders = [
"/var/localsend"
config.clan.localsend.defaultLocation
];
environment.systemPackages = [ config.clan.localsend.package ];
2024-01-17 09:33:42 +00:00
networking.firewall.interfaces."zt+".allowedTCPPorts = [ 53317 ];
networking.firewall.interfaces."zt+".allowedUDPPorts = [ 53317 ];
2024-01-17 09:33:42 +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
}