modules/communications: move simplex to the nixos configs

This commit is contained in:
Dmitriy Pleshevskiy 2024-09-06 03:12:54 +03:00
parent 374837754c
commit 0bb4941ab7
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
5 changed files with 44 additions and 8 deletions

View file

@ -33,6 +33,18 @@
local.programs.browsers.tor-browser.enable = true;
local.programs.communication = {
telegram = {
enable = true;
package = pkgs.unstable.tdesktop;
};
simplex-chat = {
enable = true;
package = pkgs.unstable.simplex-chat-desktop;
openFirewall = true;
};
};
environment.shellInit = ''
[ -n "$DISPLAY" ] && ${pkgs.xorg.xhost}/bin/xhost +si:localuser:$USER > /dev/null || true
'';

View file

@ -54,6 +54,11 @@
enable = true;
package = pkgs.unstable.tdesktop;
};
simplex-chat = {
enable = true;
package = pkgs.unstable.simplex-chat-desktop;
openFirewall = true;
};
};
containers.games = {

View file

@ -4,10 +4,6 @@
let cfg = config.local.programs.communication; in
{
options.local.programs.communication = with lib; {
simplex-chat = {
enable = mkEnableOption "SimplexChat";
package = mkPackageOption pkgs "simplex-chat-desktop" { };
};
matrix = {
enable = mkEnableOption "nheko. matrix client";
package = mkPackageOption pkgs "nheko" { };
@ -18,8 +14,9 @@ let cfg = config.local.programs.communication; in
};
};
config.home.packages =
lib.optional cfg.simplex-chat.enable cfg.simplex-chat.package
++ lib.optional cfg.matrix.enable cfg.matrix.package
++ lib.optional cfg.tox.enable cfg.tox.package;
config = {
home.packages =
lib.optional cfg.matrix.enable cfg.matrix.package
++ lib.optional cfg.tox.enable cfg.tox.package;
};
}

View file

@ -4,5 +4,6 @@
imports = [
./skype.nix
./telegram.nix
./simplex-chat.nix
];
}

View file

@ -0,0 +1,21 @@
{ config, pkgs, lib, ... }:
let
cfg = config.local.programs.communication.simplex-chat;
in
{
options.local.programs.communication.simplex-chat = with lib; {
enable = mkEnableOption "SimplexChat";
package = mkPackageOption pkgs "simplex-chat-desktop" { };
openFirewall = mkEnableOption "Open firewall to link mobile device";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = [ 44000 ];
trustedInterfaces = [ "wg0" ];
};
};
}