mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
zoom-us: allow to select xdg-desktop-portal packages (#403064)
This commit is contained in:
commit
063f43f2db
5 changed files with 139 additions and 11 deletions
|
@ -357,6 +357,7 @@
|
||||||
./programs/ydotool.nix
|
./programs/ydotool.nix
|
||||||
./programs/yubikey-touch-detector.nix
|
./programs/yubikey-touch-detector.nix
|
||||||
./programs/zmap.nix
|
./programs/zmap.nix
|
||||||
|
./programs/zoom-us.nix
|
||||||
./programs/zoxide.nix
|
./programs/zoxide.nix
|
||||||
./programs/zsh/oh-my-zsh.nix
|
./programs/zsh/oh-my-zsh.nix
|
||||||
./programs/zsh/zsh-autoenv.nix
|
./programs/zsh/zsh-autoenv.nix
|
||||||
|
|
63
nixos/modules/programs/zoom-us.nix
Normal file
63
nixos/modules/programs/zoom-us.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
options.programs.zoom-us = {
|
||||||
|
enable = lib.mkEnableOption "zoom.us video conferencing application";
|
||||||
|
package = lib.mkPackageOption pkgs "zoom-us" { };
|
||||||
|
};
|
||||||
|
|
||||||
|
config.environment.systemPackages = lib.mkIf config.programs.zoom-us.enable (
|
||||||
|
lib.singleton (
|
||||||
|
# The pattern here is to use the already-overridden value, or provide a default based on the
|
||||||
|
# configuration elsewhere.
|
||||||
|
config.programs.zoom-us.package.override (prev: {
|
||||||
|
# Support pulseaudio if it's enabled on the system.
|
||||||
|
pulseaudioSupport = prev.pulseaudioSupport or config.services.pulseaudio.enable;
|
||||||
|
|
||||||
|
# Support Plasma 6 desktop environment if it's enabled on the system.
|
||||||
|
plasma6XdgDesktopPortalSupport =
|
||||||
|
prev.plasma6XdgDesktopPortalSupport or config.services.desktopManager.plasma6.enable;
|
||||||
|
|
||||||
|
# Support Plasma 5 desktop environment if it's enabled on the system.
|
||||||
|
plasma5XdgDesktopPortalSupport =
|
||||||
|
prev.plasma5XdgDesktopPortalSupport or config.services.xserver.desktopManager.plasma5.enable;
|
||||||
|
|
||||||
|
# Support LXQT desktop environment if it's enabled on the system.
|
||||||
|
# There's also `config.services.xserver.desktopManager.lxqt.enable`
|
||||||
|
lxqtXdgDesktopPortalSupport = prev.lxqtXdgDesktopPortalSupport or config.xdg.portal.lxqt.enable;
|
||||||
|
|
||||||
|
# Support GNOME desktop environment if it's enabled on the system.
|
||||||
|
gnomeXdgDesktopPortalSupport =
|
||||||
|
prev.gnomeXdgDesktopPortalSupport or config.services.xserver.desktopManager.gnome.enable;
|
||||||
|
|
||||||
|
# Support Hyprland desktop for Wayland if it's enabled on the system.
|
||||||
|
hyprlandXdgDesktopPortalSupport =
|
||||||
|
prev.hyprlandXdgDesktopPortalSupport or config.programs.hyprland.enable;
|
||||||
|
|
||||||
|
# Support `wlroots` XDG desktop portal support if it's enabled.
|
||||||
|
wlrXdgDesktopPortalSupport = prev.wlrXdgDesktopPortalSupport or config.xdg.portal.wlr.enable;
|
||||||
|
|
||||||
|
# Support xapp XDG desktop portals if the Cinnamon desktop environment is enabled.
|
||||||
|
# The site claims that it's also used for Xfce4 and MATE; consider adding those to the
|
||||||
|
# default in the future.
|
||||||
|
xappXdgDesktopPortalSupport =
|
||||||
|
prev.xappXdgDesktopPortalSupport or config.services.xserver.desktopManager.cinnamon.enable;
|
||||||
|
|
||||||
|
# Finally, if the `xdg.portal.enable` option is set somehow, use the `targetPkgs` function
|
||||||
|
# to add those relevant packages in.
|
||||||
|
targetPkgs =
|
||||||
|
prev.targetPkgs or (
|
||||||
|
pkgs:
|
||||||
|
lib.optionals config.xdg.portal.enable (
|
||||||
|
[ pkgs.xdg-desktop-portal ] ++ config.xdg.portal.extraPortals
|
||||||
|
)
|
||||||
|
);
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
|
@ -1504,6 +1504,7 @@ in
|
||||||
zipline = runTest ./zipline.nix;
|
zipline = runTest ./zipline.nix;
|
||||||
zoneminder = runTest ./zoneminder.nix;
|
zoneminder = runTest ./zoneminder.nix;
|
||||||
zookeeper = runTest ./zookeeper.nix;
|
zookeeper = runTest ./zookeeper.nix;
|
||||||
|
zoom-us = runTest ./zoom-us.nix;
|
||||||
zram-generator = runTest ./zram-generator.nix;
|
zram-generator = runTest ./zram-generator.nix;
|
||||||
zrepl = runTest ./zrepl.nix;
|
zrepl = runTest ./zrepl.nix;
|
||||||
zsh-history = runTest ./zsh-history.nix;
|
zsh-history = runTest ./zsh-history.nix;
|
||||||
|
|
18
nixos/tests/zoom-us.nix
Normal file
18
nixos/tests/zoom-us.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ hostPkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
name = "zoom-us";
|
||||||
|
|
||||||
|
nodes.machine =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
imports = [ ./common/x11.nix ];
|
||||||
|
programs.zoom-us.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
machine.succeed("which zoom") # fail early if this is missing
|
||||||
|
machine.wait_for_x()
|
||||||
|
machine.execute("zoom >&2 &")
|
||||||
|
machine.wait_for_window("Zoom Workplace")
|
||||||
|
'';
|
||||||
|
}
|
|
@ -5,10 +5,52 @@
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
xar,
|
xar,
|
||||||
cpio,
|
cpio,
|
||||||
pulseaudioSupport ? true,
|
|
||||||
xdgDesktopPortalSupport ? true,
|
|
||||||
callPackage,
|
callPackage,
|
||||||
|
nixosTests,
|
||||||
buildFHSEnv,
|
buildFHSEnv,
|
||||||
|
|
||||||
|
# Support pulseaudio by default
|
||||||
|
pulseaudioSupport ? true,
|
||||||
|
|
||||||
|
# Whether to support XDG portals at all
|
||||||
|
xdgDesktopPortalSupport ? (
|
||||||
|
plasma6XdgDesktopPortalSupport
|
||||||
|
|| plasma5XdgDesktopPortalSupport
|
||||||
|
|| lxqtXdgDesktopPortalSupport
|
||||||
|
|| gnomeXdgDesktopPortalSupport
|
||||||
|
|| hyprlandXdgDesktopPortalSupport
|
||||||
|
|| wlrXdgDesktopPortalSupport
|
||||||
|
|| xappXdgDesktopPortalSupport
|
||||||
|
),
|
||||||
|
|
||||||
|
# This is Plasma 6 (KDE) XDG portal support
|
||||||
|
plasma6XdgDesktopPortalSupport ? false,
|
||||||
|
|
||||||
|
# This is Plasma 5 (KDE) XDG portal support
|
||||||
|
plasma5XdgDesktopPortalSupport ? false,
|
||||||
|
|
||||||
|
# This is LXQT XDG portal support
|
||||||
|
lxqtXdgDesktopPortalSupport ? false,
|
||||||
|
|
||||||
|
# This is GNOME XDG portal support
|
||||||
|
gnomeXdgDesktopPortalSupport ? false,
|
||||||
|
|
||||||
|
# This is Hyprland XDG portal support
|
||||||
|
hyprlandXdgDesktopPortalSupport ? false,
|
||||||
|
|
||||||
|
# This is `wlroots` XDG portal support
|
||||||
|
wlrXdgDesktopPortalSupport ? false,
|
||||||
|
|
||||||
|
# This is Xapp XDG portal support, used for GTK and various Cinnamon/MATE/Xfce4 infrastructure.
|
||||||
|
xappXdgDesktopPortalSupport ? false,
|
||||||
|
|
||||||
|
# This function can be overridden to add in extra packages
|
||||||
|
targetPkgs ? pkgs: [ ],
|
||||||
|
|
||||||
|
# This list can be overridden to add in extra packages
|
||||||
|
# that are independent of the underlying package attrset
|
||||||
|
targetPkgsFixed ? [ ],
|
||||||
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -100,6 +142,7 @@ let
|
||||||
|
|
||||||
passthru.updateScript = ./update.sh;
|
passthru.updateScript = ./update.sh;
|
||||||
passthru.tests.startwindow = callPackage ./test.nix { };
|
passthru.tests.startwindow = callPackage ./test.nix { };
|
||||||
|
passthru.tests.nixos-module = nixosTests.zoom-us;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://zoom.us/";
|
homepage = "https://zoom.us/";
|
||||||
|
@ -179,17 +222,19 @@ let
|
||||||
pkgs.libpulseaudio
|
pkgs.libpulseaudio
|
||||||
pkgs.pulseaudio
|
pkgs.pulseaudio
|
||||||
]
|
]
|
||||||
++ lib.optionals xdgDesktopPortalSupport [
|
++ lib.optional xdgDesktopPortalSupport pkgs.xdg-desktop-portal
|
||||||
pkgs.kdePackages.xdg-desktop-portal-kde
|
++ lib.optional plasma6XdgDesktopPortalSupport pkgs.kdePackages.xdg-desktop-portal-kde
|
||||||
pkgs.lxqt.xdg-desktop-portal-lxqt
|
++ lib.optional plasma5XdgDesktopPortalSupport pkgs.plasma5Packages.xdg-desktop-portal-kde
|
||||||
pkgs.plasma5Packages.xdg-desktop-portal-kde
|
++ lib.optional lxqtXdgDesktopPortalSupport pkgs.lxqt.xdg-desktop-portal-lxqt
|
||||||
pkgs.xdg-desktop-portal
|
++ lib.optionals gnomeXdgDesktopPortalSupport [
|
||||||
pkgs.xdg-desktop-portal-gnome
|
pkgs.xdg-desktop-portal-gnome
|
||||||
pkgs.xdg-desktop-portal-gtk
|
pkgs.xdg-desktop-portal-gtk
|
||||||
pkgs.xdg-desktop-portal-hyprland
|
]
|
||||||
pkgs.xdg-desktop-portal-wlr
|
++ lib.optional hyprlandXdgDesktopPortalSupport pkgs.xdg-desktop-portal-hyprland
|
||||||
pkgs.xdg-desktop-portal-xapp
|
++ lib.optional wlrXdgDesktopPortalSupport pkgs.xdg-desktop-portal-wlr
|
||||||
];
|
++ lib.optional xappXdgDesktopPortalSupport pkgs.xdg-desktop-portal-xapp
|
||||||
|
++ targetPkgs pkgs
|
||||||
|
++ targetPkgsFixed;
|
||||||
|
|
||||||
# We add the `unpacked` zoom archive to the FHS env
|
# We add the `unpacked` zoom archive to the FHS env
|
||||||
# and also bind-mount its `/opt` directory.
|
# and also bind-mount its `/opt` directory.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue