2024-04-11 20:15:47 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
2024-08-01 21:40:51 +02:00
|
|
|
machineProps,
|
2024-04-11 20:15:47 +02:00
|
|
|
...
|
|
|
|
}:
|
2023-10-22 17:12:42 +02:00
|
|
|
with lib;
|
|
|
|
let
|
2024-08-01 21:40:51 +02:00
|
|
|
anySwayUser =
|
|
|
|
if machineProps.enableHomeManager then
|
|
|
|
builtins.any (user: config.home-manager.users.${user}.my.desktop.sway.enable) (
|
|
|
|
builtins.attrNames config.my.users
|
|
|
|
)
|
|
|
|
else
|
|
|
|
false;
|
2024-08-14 22:43:28 +02:00
|
|
|
anySteamUser =
|
|
|
|
if machineProps.enableHomeManager then
|
|
|
|
builtins.any (user: config.home-manager.users.${user}.my.games.steam.enable) (
|
|
|
|
builtins.attrNames config.my.users
|
|
|
|
)
|
|
|
|
else
|
|
|
|
false;
|
2023-10-22 17:12:42 +02:00
|
|
|
in
|
|
|
|
{
|
2024-08-01 21:40:51 +02:00
|
|
|
programs.sway = mkIf anySwayUser {
|
2024-04-07 16:55:08 +02:00
|
|
|
enable = true;
|
|
|
|
wrapperFeatures.gtk = true;
|
2024-02-23 22:18:06 +01:00
|
|
|
};
|
|
|
|
|
2024-08-14 22:43:28 +02:00
|
|
|
programs.steam.enable = anySteamUser;
|
|
|
|
|
2024-08-01 21:40:51 +02:00
|
|
|
xdg.portal = mkIf anySwayUser {
|
2023-10-22 17:12:42 +02:00
|
|
|
enable = true;
|
2024-04-07 17:14:02 +02:00
|
|
|
xdgOpenUsePortal = true;
|
2023-10-22 17:12:42 +02:00
|
|
|
wlr.enable = true;
|
2024-04-07 17:14:02 +02:00
|
|
|
extraPortals = with pkgs; [
|
2024-09-05 19:23:12 +02:00
|
|
|
xdg-desktop-portal-gtk
|
2024-04-07 17:14:02 +02:00
|
|
|
];
|
2023-10-22 17:12:42 +02:00
|
|
|
};
|
|
|
|
}
|