2023-12-03 13:58:30 +00:00
|
|
|
# TODO(bug): signal-desktop is known to hang on exit.
|
|
|
|
# particularly, it may fail to start (because e.g. there's no wayland session yet),
|
|
|
|
# and it will try to exit -- after which the service would restart -- but it hangs w/ no GUI instead.
|
|
|
|
# characterized by these log messages:
|
|
|
|
#
|
|
|
|
# Dec 03 13:46:23 moby signal-desktop[4097]: [4097:1203/134623.906367:ERROR:ozone_platform_x11.cc(240)] Missing X server or $DISPLAY
|
|
|
|
# Dec 03 13:46:23 moby signal-desktop[4097]: [4097:1203/134623.909667:ERROR:env.cc(255)] The platform failed to initialize. Exiting.
|
2023-11-17 04:05:59 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.sane.programs.signal-desktop;
|
|
|
|
in
|
2023-11-15 23:07:03 +00:00
|
|
|
{
|
|
|
|
sane.programs.signal-desktop = {
|
2023-11-17 04:05:59 +00:00
|
|
|
configOption = with lib; mkOption {
|
|
|
|
default = {};
|
|
|
|
type = types.submodule {
|
|
|
|
options.autostart = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-20 11:11:12 +00:00
|
|
|
packageUnwrapped = pkgs.signal-desktop-from-src;
|
2024-01-23 16:42:48 +00:00
|
|
|
sandbox.method = "bwrap";
|
2024-02-08 21:51:32 +00:00
|
|
|
sandbox.net = "clearnet";
|
2024-02-13 11:14:38 +00:00
|
|
|
sandbox.whitelistAudio = true;
|
2024-02-14 01:49:49 +00:00
|
|
|
sandbox.whitelistWayland = true;
|
2024-02-15 00:49:24 +00:00
|
|
|
sandbox.extraHomePaths = [
|
|
|
|
"Music"
|
2024-02-27 21:36:18 +00:00
|
|
|
"Pictures/albums"
|
|
|
|
"Pictures/cat"
|
|
|
|
"Pictures/from"
|
|
|
|
"Pictures/Photos"
|
|
|
|
"Pictures/Screenshots"
|
2024-02-15 00:49:24 +00:00
|
|
|
"Pictures/servo-macros"
|
2024-02-27 21:36:18 +00:00
|
|
|
"Videos/local"
|
2024-02-15 00:49:24 +00:00
|
|
|
"Videos/servo"
|
|
|
|
"tmp"
|
|
|
|
];
|
2023-11-17 04:05:59 +00:00
|
|
|
|
2023-11-15 23:07:03 +00:00
|
|
|
# creds, media
|
|
|
|
persist.byStore.private = [
|
|
|
|
".config/Signal"
|
|
|
|
];
|
2023-11-17 04:05:59 +00:00
|
|
|
|
|
|
|
services.signal-desktop = {
|
2024-02-19 12:57:44 +00:00
|
|
|
description = "signal-desktop Signal Messenger client";
|
2024-03-21 16:02:06 +00:00
|
|
|
# depends = [ "graphical-session" ];
|
|
|
|
partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
|
2024-05-15 00:10:00 +00:00
|
|
|
command = "signal-desktop";
|
2023-11-17 04:05:59 +00:00
|
|
|
};
|
2023-11-15 23:07:03 +00:00
|
|
|
};
|
|
|
|
}
|