-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos-infra jitsi prep #297809
nixos-infra jitsi prep #297809
Changes from all commits
1276322
812c2fc
417ba42
7651bdb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,10 +336,10 @@ let | |
''; | ||
}; | ||
|
||
vcard_muc = mkOption { | ||
type = types.bool; | ||
default = true; | ||
description = lib.mdDoc "Adds the ability to set vCard for Multi User Chat rooms"; | ||
extraModules = mkOption { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lists tend to be annoying because they make it very difficult to remove items from the default value. Can this be an attrset instead with e.g. (I actually don't know if we have something better as a common pattern for this in NixOS - I just know lists are annoying and that's how I would intuitively have go at fixing this.) |
||
type = types.listOf types.str; | ||
default = [ "muc_mam" "vcard_muc" ]; | ||
description = "Add more modules to the muc Component"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Capitalize |
||
}; | ||
|
||
# Extra parameters. Defaulting to prosody default values. | ||
|
@@ -814,7 +814,9 @@ in | |
|
||
${lib.concatMapStrings (muc: '' | ||
Component ${toLua muc.domain} "muc" | ||
modules_enabled = { "muc_mam"; ${optionalString muc.vcard_muc ''"vcard_muc";'' } } | ||
modules_enabled = { | ||
${ lib.concatStringsSep "\n" (map (x: "${toLua x};") muc.extraModules)} | ||
} | ||
name = ${toLua muc.name} | ||
restrict_room_creation = ${toLua muc.restrictRoomCreation} | ||
max_history_messages = ${toLua muc.maxHistoryMessages} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,6 +189,19 @@ in | |
}; | ||
|
||
secureDomain.enable = mkEnableOption (lib.mdDoc "Authenticated room creation"); | ||
|
||
updateMucs = mkOption { | ||
type = with types; attrsOf anything; | ||
default = { }; | ||
description = "This is a very hacky work around setting and only added because prosody muc is a list."; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This descriptions tells me nothing at all about how this option is expected to be used or what it does. My understanding is that this is a way to inject extra Prosody settings for a MUC, which is difficult to do otherwise due to the combination of 1. the Prosody module not using an attrset for its instances; 2. the Jitsi module being in charge of configuring Prosody itself?
|
||
example = { | ||
"conference.jitsi.example.com".extraModules = [ | ||
"lobby_autostart" | ||
"muc_mam" | ||
"vcard_muc" | ||
]; | ||
}; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
|
@@ -205,7 +218,16 @@ in | |
tls = mkDefault true; | ||
websocket = mkDefault true; | ||
}; | ||
muc = [ | ||
# the piece of code bellow looks at the domain name of the attrs in the list and updates the attrs if the domain name matches. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: below |
||
# this is done to allow adding/overriding settings in a convenient way | ||
muc = lib.flatten (builtins.map (muc: | ||
let | ||
result = lib.mapAttrsToList ( | ||
n: v: if muc.domain == n then (lib.recursiveUpdate muc v) else null | ||
) cfg.updateMucs; | ||
in | ||
if result == [ null ] then muc else result | ||
) [ | ||
{ | ||
domain = "conference.${cfg.hostName}"; | ||
name = "Jitsi Meet MUC"; | ||
|
@@ -249,7 +271,7 @@ in | |
storage = "memory" | ||
''; | ||
} | ||
]; | ||
]); | ||
extraModules = [ | ||
"pubsub" | ||
"smacks" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ lib | ||
, fetchFromGitHub | ||
, stdenvNoCC | ||
}: | ||
stdenvNoCC.mkDerivation (finalAttrs: { | ||
pname = "jitsi-prosody-plugins"; | ||
version = "20240318"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "jitsi-contrib"; | ||
repo = "prosody-plugins"; | ||
rev = "v${finalAttrs.version}"; | ||
hash = "sha256-ZApx7Z08dr1EFL5eelFG3IrfrAOpg5JqUX6hbodGwuo="; | ||
}; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
|
||
mkdir -p $out | ||
rm LICENSE README.md */README*.md | ||
rm -r images */docs | ||
cp -r * $out/ | ||
|
||
runHook postInstall | ||
''; | ||
|
||
# nothing todo here | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: to do (And it would be more useful to document why - which is because it's all just Lua scripts.) |
||
dontBuild = true; | ||
dontConfigure = true; | ||
dontFixup = true; | ||
|
||
meta = with lib; { | ||
description = "Prosody plugins for Jitsi"; | ||
homepage = "https://github.com/jitsi-contrib/prosody-plugins"; | ||
license = lib.licenses.apsl20; | ||
maintainers = with lib.maintainers; [ janik ]; | ||
}; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkRemovedOptionModule
?