Merge pull request #311189 from Luis-Licea/master

nixos/localsend: init
This commit is contained in:
Masum Reza 2024-07-14 19:53:43 +05:30 committed by GitHub
commit 47d9445dfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 57 additions and 2 deletions

View File

@ -30,6 +30,8 @@
- [Envision](https://gitlab.com/gabmus/envision), a UI for building, configuring and running Monado, the open source OpenXR runtime. Available as [programs.envision](#opt-programs.envision.enable).
- [Localsend](https://localsend.org/), an open source cross-platform alternative to AirDrop. Available as [programs.localsend](#opt-programs.localsend.enable).
- [realm](https://github.com/zhboner/realm), a simple, high performance relay server written in rust. Available as [services.realm.enable](#opt-services.realm.enable).
- [Playerctld](https://github.com/altdesktop/playerctl), a daemon to track media player activity. Available as [services.playerctld](option.html#opt-services.playerctld).

View File

@ -226,6 +226,7 @@
./programs/less.nix
./programs/liboping.nix
./programs/light.nix
./programs/localsend.nix
./programs/mdevctl.nix
./programs/mepo.nix
./programs/mininet.nix

View File

@ -0,0 +1,26 @@
{
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";
openFirewall = lib.mkEnableOption "opening the firewall port ${toString firewallPort} for receiving files" // {
default = true;
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.localsend ];
networking.firewall.allowedTCPPorts = lib.optionals cfg.openFirewall [ firewallPort ];
};
meta.maintainers = with lib.maintainers; [ pandapip1 ];
}

View File

@ -516,6 +516,7 @@ in {
listmonk = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./listmonk.nix {};
litestream = handleTest ./litestream.nix {};
lldap = handleTest ./lldap.nix {};
localsend = handleTest ./localsend.nix {};
locate = handleTest ./locate.nix {};
login = handleTest ./login.nix {};
logrotate = handleTest ./logrotate.nix {};

21
nixos/tests/localsend.nix Normal file
View File

@ -0,0 +1,21 @@
import ./make-test-python.nix (
{ ... }:
{
name = "localsend";
nodes.machine =
{ ... }:
{
imports = [ ./common/x11.nix ];
programs.localsend.enable = true;
};
testScript = ''
machine.wait_for_x()
machine.succeed("localsend_app >&2 &")
machine.wait_for_open_port(53317)
machine.wait_for_window("LocalSend", 10)
machine.succeed("netstat --listening --program --tcp | grep -P 'tcp.*53317.*localsend'")
'';
}
)

View File

@ -4,6 +4,7 @@
, fetchFromGitHub
, flutter313
, makeDesktopItem
, nixosTests
, pkg-config
, libayatana-appindicator
, undmg
@ -58,7 +59,10 @@ let
categories = [ "Network" ];
};
passthru.updateScript = ./update.sh;
passthru = {
updateScript = ./update.sh;
tests.localsend = nixosTests.localsend;
};
meta = metaCommon // {
mainProgram = "localsend_app";
@ -94,7 +98,7 @@ let
homepage = "https://localsend.org/";
license = licenses.mit;
mainProgram = "localsend";
maintainers = with maintainers; [ sikmir linsui ];
maintainers = with maintainers; [ sikmir linsui pandapip1 ];
};
in
if stdenv.isDarwin