modules/communications: move simplex to the nixos configs
This commit is contained in:
parent
374837754c
commit
0bb4941ab7
5 changed files with 44 additions and 8 deletions
|
@ -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
|
||||
'';
|
||||
|
|
|
@ -54,6 +54,11 @@
|
|||
enable = true;
|
||||
package = pkgs.unstable.tdesktop;
|
||||
};
|
||||
simplex-chat = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.simplex-chat-desktop;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
|
||||
containers.games = {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,5 +4,6 @@
|
|||
imports = [
|
||||
./skype.nix
|
||||
./telegram.nix
|
||||
./simplex-chat.nix
|
||||
];
|
||||
}
|
||||
|
|
21
modules/nixos/programs/communication/simplex-chat.nix
Normal file
21
modules/nixos/programs/communication/simplex-chat.nix
Normal 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" ];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue