mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-22 08:30:57 +00:00
nixos/localsend: add package option & allow udp port (#333485)
This commit is contained in:
@@ -12,14 +12,19 @@ in
|
||||
options.programs.localsend = {
|
||||
enable = lib.mkEnableOption "localsend, an open source cross-platform alternative to AirDrop";
|
||||
|
||||
openFirewall = lib.mkEnableOption "opening the firewall port ${toString firewallPort} for receiving files" // {
|
||||
default = true;
|
||||
};
|
||||
package = lib.mkPackageOption pkgs "localsend" { };
|
||||
|
||||
openFirewall =
|
||||
lib.mkEnableOption "opening the firewall port ${toString firewallPort} for receiving files"
|
||||
// {
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.localsend ];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
networking.firewall.allowedTCPPorts = lib.optionals cfg.openFirewall [ firewallPort ];
|
||||
networking.firewall.allowedUDPPorts = lib.optionals cfg.openFirewall [ firewallPort ];
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ pandapip1 ];
|
||||
|
||||
@@ -16,6 +16,7 @@ import ./make-test-python.nix (
|
||||
machine.wait_for_open_port(53317)
|
||||
machine.wait_for_window("LocalSend", 10)
|
||||
machine.succeed("netstat --listening --program --tcp | grep -P 'tcp.*53317.*localsend'")
|
||||
machine.succeed("netstat --listening --program --udp | grep -P 'udp.*53317.*localsend'")
|
||||
'';
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user