{ config, lib, pkgs, ... }: with lib; let cfg = config.ezpc; in { options.ezpc.enable = mkEnableOption "Enable ezpc system stuff"; config = mkIf cfg.enable { xdg.portal = { enable = lib.mkDefault true; wlr = { enable = lib.mkDefault true; settings = { screencast = { max_fps = lib.mkDefault 30; chooser_type = lib.mkDefault "simple"; chooser_cmd = lib.mkDefault "${pkgs.slurp}/bin/slurp -f %o -or"; }; }; }; extraPortals = with pkgs; [ # used for xdg-open and whatnot xdg-desktop-portal-gtk xdg-desktop-portal-kde ]; }; environment.sessionVariables = { QT_QPA_PLATFORM = "wayland-egl;xcb"; MOZ_ENABLE_WAYLAND = "1"; QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; ECORE_EVAS_ENGINE = "wayland_egl"; ELM_ENGINE = "wayland_egl"; _JAVA_AWT_WM_NONREPARENTING = "1"; NIXOS_OZONE_WL = "1"; }; services.greetd = { enable = true; vt = 1; settings = { default_session = { # command = "${pkgs.greetd.tuigreet}/bin/tuigreet --cmd sway"; command = let swayGreeterConfig = pkgs.writeText "sway-greeter-config" '' exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway; swaymsg exit" bindsym Mod4+shift+e exec swaynag \ -t warning \ -m 'What do you want to do?' \ -b 'Poweroff' 'systemctl poweroff' \ -b 'Reboot' 'systemctl reboot' ''; in "${pkgs.sway}/bin/sway --config ${swayGreeterConfig}"; }; }; }; i18n.inputMethod = { enabled = "ibus"; ibus.engines = with pkgs.ibus-engines; [typing-booster uniemoji]; }; }; }