nixos-config/user/chat.nix

60 lines
2 KiB
Nix
Raw Normal View History

2022-12-06 20:19:12 -03:00
{ config, pkgs, lib, inputs, ... }: {
2022-10-24 20:16:41 -03:00
systemd.user.services = {
2023-01-24 23:32:07 -03:00
astroid = lib.mkIf (pkgs.uservars.email-client == "astroid") {
Unit = {
Description = "Astroid Email client";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStartPre = "/usr/bin/env sleep 10s";
ExecStart = "${pkgs.astroid}/bin/astroid";
Restart = "on-failure";
2023-02-08 12:43:01 -03:00
TimeoutStopSec = 10;
2023-01-24 23:32:07 -03:00
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
thunderbird = lib.mkIf (pkgs.uservars.email-client == "thunderbird") {
2022-12-06 22:25:31 -03:00
Unit = {
Description = "Thunderbird Email client";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
2022-12-21 21:06:47 -03:00
ExecStartPre = "/usr/bin/env sleep 10s";
2022-12-06 22:25:31 -03:00
ExecStart = "${pkgs.thunderbird}/bin/thunderbird";
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
2022-10-24 20:16:41 -03:00
discord = {
Unit = {
Description = "Discord Internet voice chat";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" "pipewire-pulse.service" "tray.service" "telegram.service" ];
2022-10-24 20:16:41 -03:00
};
Service = {
2022-12-21 21:06:47 -03:00
ExecStartPre = "/usr/bin/env sleep 12s";
2022-12-06 20:19:12 -03:00
ExecStart = "${pkgs.webcord}/bin/webcord";
2022-10-24 20:16:41 -03:00
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
telegram = {
Unit = {
Description = "Telegram Internet chat";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" "pipewire-pulse.service" "tray.service" ];
2022-10-24 20:16:41 -03:00
};
Service = {
2022-12-21 21:06:47 -03:00
ExecStartPre = "/usr/bin/env sleep 11s";
ExecStart = "${pkgs.tdesktop}/bin/telegram-desktop";
2022-10-24 20:16:41 -03:00
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
};
2022-12-06 22:25:31 -03:00
home.packages = with pkgs; [ tdesktop webcord thunderbird ];
2022-10-24 20:16:41 -03:00
}