nixos-config/modules/workstation/desktop.nix
2024-08-01 21:40:51 +02:00

34 lines
594 B
Nix

{
config,
lib,
pkgs,
machineProps,
...
}:
with lib;
let
anySwayUser =
if machineProps.enableHomeManager then
builtins.any (user: config.home-manager.users.${user}.my.desktop.sway.enable) (
builtins.attrNames config.my.users
)
else
false;
in
{
programs.sway = mkIf anySwayUser {
enable = true;
wrapperFeatures.gtk = true;
};
xdg.portal = mkIf anySwayUser {
enable = true;
xdgOpenUsePortal = true;
wlr.enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gnome
xdg-desktop-portal-kde
];
};
}