nixos/localsend: add package option

This commit is contained in:
Guanran Wang 2024-08-09 23:16:10 +08:00
parent 7bdd525de2
commit 9ac4777d98
No known key found for this signature in database
GPG Key ID: 91F97D9ED12639CF

View File

@ -12,13 +12,17 @@ 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 ];
};