2023-01-20 21:13:14 +00:00
|
|
|
{
|
2023-06-18 00:46:31 +00:00
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.mod.mosh;
|
|
|
|
in {
|
2023-01-20 21:13:14 +00:00
|
|
|
options.mod.mosh = {
|
|
|
|
enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
description = "enable mosh";
|
|
|
|
default = true;
|
|
|
|
example = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
2023-06-18 00:46:31 +00:00
|
|
|
environment.systemPackages = [pkgs.mosh];
|
2023-01-20 21:13:14 +00:00
|
|
|
networking.firewall = lib.mkIf config.networking.firewall.enable {
|
|
|
|
allowedUDPPortRanges = [
|
2023-06-18 00:46:31 +00:00
|
|
|
{
|
|
|
|
from = 60000;
|
|
|
|
to = 61000;
|
|
|
|
} # mosh
|
2023-01-20 21:13:14 +00:00
|
|
|
];
|
|
|
|
};
|
2022-12-25 23:15:15 +00:00
|
|
|
};
|
|
|
|
}
|