nixos-config/modules/workstation/desktop.nix

42 lines
822 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;
anySteamUser =
if machineProps.enableHomeManager then
builtins.any (user: config.home-manager.users.${user}.my.games.steam.enable) (
builtins.attrNames config.my.users
)
else
false;
in
{
programs.sway = mkIf anySwayUser {
enable = true;
wrapperFeatures.gtk = true;
};
programs.steam.enable = anySteamUser;
xdg.portal = mkIf anySwayUser {
enable = true;
xdgOpenUsePortal = true;
wlr.enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
};
}