nixpkgs/nixos/modules/programs/localsend.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
792 B
Nix
Raw Permalink Normal View History

2024-05-12 14:48:12 -06:00
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.localsend;
firewallPort = 53317;
in
{
options.programs.localsend = {
enable = lib.mkEnableOption "localsend, an open source cross-platform alternative to AirDrop";
2024-08-09 09:16:10 -06:00
package = lib.mkPackageOption pkgs "localsend" { };
openFirewall =
lib.mkEnableOption "opening the firewall port ${toString firewallPort} for receiving files"
// {
default = true;
};
2024-05-12 14:48:12 -06:00
};
config = lib.mkIf cfg.enable {
2024-08-09 09:16:10 -06:00
environment.systemPackages = [ cfg.package ];
2024-05-12 14:48:12 -06:00
networking.firewall.allowedTCPPorts = lib.optionals cfg.openFirewall [ firewallPort ];
2024-08-09 09:16:30 -06:00
networking.firewall.allowedUDPPorts = lib.optionals cfg.openFirewall [ firewallPort ];
2024-05-12 14:48:12 -06:00
};
meta.maintainers = with lib.maintainers; [ pandapip1 ];
2024-05-12 14:48:12 -06:00
}