nix-files/hosts/common/programs/signal-desktop.nix

38 lines
937 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.signal-desktop;
in
{
sane.programs.signal-desktop = {
configOption = with lib; mkOption {
default = {};
type = types.submodule {
options.autostart = mkOption {
type = types.bool;
default = false;
};
};
};
package = pkgs.signal-desktop-from-src;
# creds, media
persist.byStore.private = [
".config/Signal"
];
services.signal-desktop = {
description = "Signal Messenger";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/signal-desktop";
Type = "simple";
Restart = "always";
RestartSec = "20s";
};
# for some reason the --ozone-platform-hint=auto flag fails when signal-desktop is launched from a service
environment.NIXOS_OZONE_WL = "1";
};
};
}