2023-09-17 05:00:15 +00:00
|
|
|
# GNOME calls
|
|
|
|
# - <https://gitlab.gnome.org/GNOME/calls>
|
|
|
|
# - both a dialer and a call handler.
|
|
|
|
# - uses callaudiod dbus package.
|
|
|
|
#
|
|
|
|
# initial JMP.chat configuration:
|
|
|
|
# - message @cheogram.com "reset sip account" (this is not destructive, despite the name)
|
|
|
|
# - the bot will reply with auto-generated username/password plus a SIP server endpoint.
|
|
|
|
# just copy those into gnome-calls' GUI configurator
|
|
|
|
# - now gnome-calls can do outbound calls. inbound calls requires more chatting with the help bot
|
|
|
|
#
|
|
|
|
# my setup here is still very WIP.
|
|
|
|
# open questions:
|
|
|
|
# - can i receive calls even with GUI closed?
|
|
|
|
# - e.g. activated by callaudiod?
|
|
|
|
# - looks like `gnome-calls --daemon` does that?
|
|
|
|
{ config, lib, ... }:
|
2023-09-17 05:53:05 +00:00
|
|
|
let
|
|
|
|
cfg = config.sane.programs.calls;
|
|
|
|
in
|
2023-09-17 05:00:15 +00:00
|
|
|
{
|
|
|
|
sane.programs.calls = {
|
2023-09-21 19:44:11 +00:00
|
|
|
configOption = with lib; mkOption {
|
|
|
|
default = {};
|
|
|
|
type = types.submodule {
|
|
|
|
options.autostart = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-08 15:32:50 +00:00
|
|
|
persist.byStore.private = [
|
2023-09-17 05:57:21 +00:00
|
|
|
# ".cache/folks" # contact avatars?
|
2023-09-17 05:53:05 +00:00
|
|
|
# ".config/calls"
|
2023-09-17 05:00:15 +00:00
|
|
|
".local/share/calls" # call "records"
|
|
|
|
# .local/share/folks # contacts?
|
|
|
|
];
|
2023-09-17 05:53:05 +00:00
|
|
|
secrets.".config/calls/sip-account.cfg" = ../../../secrets/common/gnome_calls_sip-account.cfg.bin;
|
2023-09-17 05:00:15 +00:00
|
|
|
suggestedPrograms = [
|
|
|
|
"feedbackd" # needs `phone-incoming-call`, in particular
|
|
|
|
];
|
2023-09-17 05:53:05 +00:00
|
|
|
|
|
|
|
services.gnome-calls = {
|
2023-09-21 19:44:11 +00:00
|
|
|
# TODO: prevent gnome-calls from daemonizing when started manually
|
2023-09-17 05:53:05 +00:00
|
|
|
description = "gnome-calls daemon to monitor incoming SIP calls";
|
2023-09-21 19:44:11 +00:00
|
|
|
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ];
|
2023-09-17 05:53:05 +00:00
|
|
|
serviceConfig = {
|
|
|
|
# add --verbose for more debugging
|
|
|
|
ExecStart = "${cfg.package}/bin/gnome-calls --daemon";
|
|
|
|
Type = "simple";
|
2023-09-21 19:44:11 +00:00
|
|
|
Restart = "always";
|
2023-09-17 05:53:05 +00:00
|
|
|
RestartSec = "10s";
|
|
|
|
};
|
|
|
|
environment.G_MESSAGES_DEBUG = "all";
|
|
|
|
};
|
2023-09-17 05:00:15 +00:00
|
|
|
};
|
2023-09-17 05:53:05 +00:00
|
|
|
programs.calls = lib.mkIf cfg.enabled {
|
2023-09-17 05:00:15 +00:00
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
}
|