Update modules/matrix-synapse.nix

This commit is contained in:
Alexander Bantyev 2020-02-26 14:42:13 +03:00
parent eda96d7e02
commit 971dfdc28b

View File

@ -37,49 +37,16 @@
(builtins.toJSON config.secrets.matrix.mautrix-whatsapp.registration)) (builtins.toJSON config.secrets.matrix.mautrix-whatsapp.registration))
]; ];
}; };
systemd.services.whatsapp-vm = { home-manager.users.balsoft.xsession.windowManager.i3.config.startup = [{
description = "Android VM with WhatsApp"; command = "anbox launch --package=com.whatsapp --component=.HomeActivity";
wantedBy = [ "multi-user.target" ]; }];
requires = [ "network-online.target" ];
preStart = "mkdir -p /var/lib/whatsapp";
path = [ pkgs.coreutils ];
serviceConfig = {
Restart = "always";
RestartSec = 1;
TimeoutStartSec = "60";
Type = "forking";
};
script = ''
NIX_ANDROID_EMULATOR_FLAGS="-no-audio -no-window -read-only" ${
with import (import ../nix/sources.nix).nixpkgs {
config.android_sdk.accept_license = true;
};
androidenv.emulateApp {
name = "WhatsApp";
app = fetchurl {
name = "WhatsApp.apk";
url =
"https://scontent.whatsapp.net/v/t61/69881048_788414318339970_5200101795019358208_n.apk/WhatsApp.apk?_nc_ohc=KuY9gcFeMBEAX_CssFG&_nc_ht=scontent.whatsapp.net&oh=ccfa509a03cd16f148e62b2ee5aa47cc&oe=5E3F4CBC";
sha256 = "1gc4lilpf2gaa61hbqiafnhqy3xvcnvjr6bmyb59cmmx8b4zmql1";
};
platformVersion = "18";
abiVersion = "x86";
package = "com.whatsapp";
activity = ".HomeActivity";
avdHomeDir = "/var/lib/whatsapp";
}
}/bin/run-test-emulator
'';
};
systemd.services.mautrix-whatsapp = { systemd.services.mautrix-whatsapp = {
description = "A bridge between whatsapp and matrix"; description = "A bridge between whatsapp and matrix";
path = with pkgs; [ coreutils mautrix-whatsapp ]; path = with pkgs; [ coreutils mautrix-whatsapp ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
requires = [ requires = [
"matrix-synapse.service" "matrix-synapse.service"
"whatsapp-vm.service" "anbox-container-manager.service"
"network-online.target" "network-online.target"
]; ];
serviceConfig = { serviceConfig = {