1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7 cfg = config.programs.mosh;
8
9in
10{
11 options.programs.mosh = {
12 enable = mkOption {
13 description = ''
14 Whether to enable mosh. Note, this will open ports in your firewall!
15 '';
16 default = false;
17 type = lib.types.bool;
18 };
19 };
20
21 config = mkIf cfg.enable {
22 environment.systemPackages = with pkgs; [ mosh ];
23 networking.firewall.allowedUDPPortRanges = [ { from = 60000; to = 61000; } ];
24 };
25}