2024-06-12 09:54:11 +07:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
2024-10-20 16:34:59 +07:00
|
|
|
inherit (lib) mkIf;
|
|
|
|
inherit (lib.meta) getExe;
|
2024-06-12 09:54:11 +07:00
|
|
|
cfg = config.profile.discord;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = with pkgs; [
|
2024-10-20 11:21:34 +07:00
|
|
|
vesktop
|
2024-06-12 09:54:11 +07:00
|
|
|
];
|
|
|
|
|
2024-10-20 11:21:34 +07:00
|
|
|
home.file = {
|
|
|
|
".config/discord/settings.json".text = builtins.toJSON {
|
|
|
|
SKIP_HOST_UPDATE = true;
|
2024-06-12 09:54:11 +07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-10-20 11:21:34 +07:00
|
|
|
wayland.windowManager.hyprland.settings.exec-once = lib.mkIf cfg.autostart [
|
|
|
|
"sleep 10; until ${pkgs.unixtools.ping}/bin/ping -c 1 discord.com; do sleep 1; done; vesktop"
|
|
|
|
];
|
2024-10-20 16:34:59 +07:00
|
|
|
|
|
|
|
services.swaync.settings.scripts._10-discord =
|
|
|
|
let
|
|
|
|
script = pkgs.callPackage ../../scripts/hyprland/focus-window.nix { };
|
|
|
|
in
|
|
|
|
{
|
|
|
|
app-name = "discord";
|
|
|
|
exec = "${getExe script}";
|
|
|
|
run-on = "action";
|
|
|
|
};
|
2024-06-12 09:54:11 +07:00
|
|
|
};
|
|
|
|
}
|